Css中属性继承

来源:互联网 发布:office for mac 威锋 编辑:程序博客网 时间:2024/05/17 01:40

肯定有很多人不知道什么是继承,继承就是指子节点默认使用父节点的样式属性。
不可继承的属性太多了不要背,记住可以继承的属性有哪些就行了。可以继承的属性很少,只有颜色,文字,字体间距行高对齐方式,和列表的样式可以继承。这么来记很轻松的呀!不要被下边的吓到了哦~
所有元素可继承: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。

原创粉丝点击