一、css不可以繼承的屬性
display、
margin、padding、border、
background、
width、min-width、max-width、height、min-height、max-height、
overflow、
position、top、bottom、left、right、z-index、
float、clear、table-layout、vertical-align、
page-bread-before、page-bread-after、unicode-bidi
二、所有元素都可以繼承
visibility、
cursor
三、子元素可以繼承
letter-spacing(字符間距)
word-spacing(單詞間距)
white-space(如何處理元素內的空白)
line-height(設置行高,內聯元素不可以繼承,設置為行內塊元素可以繼承)
color、font、font-size、font-family、font-style、font-weight、font-variant(大寫字母)
text-decoration(文本下划線、中划線)、text-transform(首字母大寫、轉大寫)、direction(rtl-文本方向從右向左)
text-indent(首行縮進)、text-align(文本對齊)
四、列表元素(li)可繼承
list-style、list-style-type、list-style-position、list-style-image
五、表格元素可繼承
border-collapse
六、對於不可繼承的屬性,如果希望子元素可以保持和父元素一致,可以將該屬性值設置為inherit
border: inherit;