CSS中可继承的属性

html-css010

CSS中可继承的属性,第1张

所有元素可继承 :visibility(可见性)和 cursor (光标属性)

内联元素可继承 :font、font-size、font-family、font-style、font-variant、font-weight、text-decoration、text-align、letter-spacing、word-spacing、white-space、line-height、color、

块级元素可以继承的属性 :text-indent、text-align、

列表元素可继承 :list-style、list-style-type、list-style-position、list-style-image、

只有块元素才可以默认“继承”其父元素的width.

浮动元素和定位元素也是不默认(不自动)“继承”其父元素宽度的。

当符合css默认“继承”的情况下(子元素必须是块级元素且无定位或浮动),是不需要写width属性,就可以默认“继承”的。