css-可继承和不可继承的属性

来源:互联网 发布:江户川乱步 知乎 编辑:程序博客网 时间:2024/05/21 10:50

1.css哪些属性可以继承?哪些不可继承?

css属性分类

字体属性:

font-family,font-size,font-style,font-variant,font-weight,font可继承

ps: font-size继承的是计算后的实际值

文本属性:

word-spacing letter-spacing text-align text-transform text-indent line-height可以继承

text-decoration vertical-align不可继承

颜色背景属性:

color可以继承

background(background-color background-image background-repeat background-attachment background-position)不可继承

边框属性:

border(border-top border-right border-bottom border-left)(border-width border-style border-color)不可以继承

定位和布局属性:

margin padding width height float clear position left top overflow z-index display不可以继承

列表属性:

list-style-image, list-style-position,list-style-type, list-style可以继承

0 0