css属性的可继承性

不可继承的:display、margin、border、padding、background、height、min-height、max- height、width、min-width、max-width、overflow、position、left、right、top、 bottom、z-index、float、clear、table-layout、vertical-align、page-break-after、 page-bread-before和unicode-bidi。

所有元素可继承:visibility和cursor。
内联元素可继承:letter-spacing、word-spacing、white-space、line-height、color、font、 font-family、font-size、font-style、font-variant、font-weight、text- decoration、text-transform、direction。
块状元素可继承:text-indent和text-align。
列表元素可继承:list-style、list-style-type、list-style-position、list-style-image。
表格元素可继承:border-collapse。
相反,可继承就是父节点设置了这个属性后,子节点就可以继承他的属性,
这里要明白什么是块状元素,内联元素。 块状元素,是其属性display的默认值为block的标签,也就是div,p,h1等等,但不代表这些标签一定是块状元素,当程序员把他的display属性改变,就不是块状元素
每个程序员,都是艺术家.
原文地址:https://www.cnblogs.com/moriah/p/6238253.html