CSS的inherit与auto使用分析_经验交流
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CSS的inherit与auto使用分析_经验交流,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4544字,纯文字阅读大概需要7分钟。
内容图文
![CSS的inherit与auto使用分析_经验交流](/upload/InfoBanner/zyjiaocheng/417/f7c02ff3545245afbbad1e2c09de3582.jpg)
在CSS中,许多属性都是可以继承的,如某个段落的字体设置为白色,其元素的字体不用设置或设置为inhert,它就是白色。这些属性被称之为inherited property,它会从父元素获取对应属性的经过计算与转换的值(computed value),如果父元素和它的情形一样,它就继续往上找,最后没有就使用浏览器的默认值。
下面是 inherited properties的一览表:
代码如下:
border-collapse
border-spacing
caption-side
color
cursor
direction
empty-cells
font
font-family
font-stretch
font-size
font-size-adjust
font-style
font-variant
font-weight
letter-spacing
line-height
list-style
opacity
list-style-image
list-style-type
quotes
text-align
text-indent
text-transform
white-space
word-spacing