CSS 选择符有哪些?哪些属性可以继承?优先级算法如何计算?

CSS 选择符有哪些?

1.id选择器(#id)

2.类选择器(.class)

3.标签选择器(div,h1,p)

4.相邻选择器(h1 + p)

5.子选择器(ul > li)

6.后代选择器(li a)

7.通配符选择器( * )

8.属性选择器(a[title])

9.伪类选择器(a:hover,li:nth-child)

 

 

可继承的样式

1.字体系列属性 font,font-family,font-weight,font-size,font-style,font-variant,font-stretch,font-size-adjust

2.文本系列属性 text-indent,text-align,line-height,word-spacing,letter-spacing,text-transform,direction,color

3.元素可见性 visibility

4.表格布局属性 caption-side,border-collapse,border-spacing,empty-cells,table-layout

5.列表布局属性 list-style-type,list-style-image,list-style-position,list-style

6.生成内容属性 quotes

7.光标属性 cursor

8.页面样式属性 page,page-break-inside,windows,orphans

9.声音样式属性 speak,speak-punctuation,speak-numeral,speak-header,speech-rate,volume,voice-family,pitch,pitch-range,stress,richness,azimuth,elevation

 

优先级算法如何计算?

1.优先级就近原则,同权重情况下样式定义最近者为准;

2.载入样式以最后载入的定位为准;

3.!important > id > class > tag;

4.important 比 内联优先级高,但内联比id要高;

 

来源:出  处:https://www.cnblogs.com/miluluyo/p/11134342.html

转载于:https://www.cnblogs.com/huchong-bk/p/11613482.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值