css中哪些属性可以继承,哪些不可以继承?
一、能继承的属性
- 字体系列属性:font、font-family、font-weight、font-size、font-style;
- 文本系列属性: 2.1)内联元素:color、line-height、word-spacing、letter-spacing、 text-transform; 2.2)块级元素:text-indent、text-align;
- 元素可见性:visibility
- 表格布局属性:caption-side、border-collapse、border-spacing、empty-cells、 table-layout;
- 列表布局属性:list-style
二、不能继承的属性
- display:规定元素应该生成的框的类型;
- 文本属性:vertical-align、text-decoration;
- 盒子模型的属性:width、height、margin 、border、padding;
- 背景属性:background、background-color、background-image;
- 定位属性:float、clear、position、top、right、bottom、left、min-width、 min-height、max-width、max-height、overflow、clip;
作者:code_fly
链接:https://juejin.cn/post/7021140417890484255
来源:稀土掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
链接:https://juejin.cn/post/7021140417890484255
来源:稀土掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

浙公网安备 33010602011771号