css可继承与不可继承的属性

一、可继承性的属性

字体相关的:font-size/font-family/font-weight/font-style/font-variant/font-stretch

文本相关的:color/text-align/text-indent/line-height/letter-spacing/word-spacing/text-transform/direction

元素可见性:visibility

表格属性:table-layout/border-collapse/

cursor

 

二、不可继承的属性

定位属性:float/position/top/right/bottom/left/min-width/min-height/max-width/max-height/z-index/clear/overflow/clip

盒子模型的属性:width/height/margin(上下左右)/padding(上下左右)/border(相关样式)

背景属性:background/background-color/background-image/background-position/background-repeat

尺寸:size

 

posted @ 2022-04-01 16:51  梁文璇say  阅读(143)  评论(0)    收藏  举报