css中可继承的样式属性总结

链接:https://www.nowcoder.com/questionTerminal/0c76b5ff84fd4814b4ba4d45af3185b6?source=relative
来源:牛客网
 

肯定有很多人不知道什么是继承,继承就是指子节点默认使用父节点的样式属性。

不可继承的属性太多了不要背,记住可以继承的属性有哪些就行了。可以继承的属性很少,只有颜色,文字,字体间距行高对齐方式,和列表的样式可以继承。这么来记很轻松的呀!不要被下边的吓到了哦~

所有元素可继承:visibility和cursor。
内联元素可继承:letter-spacingword-spacingwhite-spaceline-height、color、font、font-family、font-size、font-style、font-variant、font-weighttext-decoration、text-transform、direction。
终端块状元素可继承:text-indent和text-align。
列表元素可继承:list-style、list-style-type、list-style-position、list-style-image。

猜你喜欢

转载自blog.csdn.net/gloria_chenjing/article/details/81092358
今日推荐