CSS中能夠和不能夠繼承的屬性

CSS樣式中不是所有的屬性都是能夠被子元素繼承的,下面列出 CSS中能夠和不能夠繼承的屬性。spa

不可繼承的:

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。code

 

全部元素可繼承:  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。

相關文章
相關標籤/搜索