css中那些属性可以被继承

主要的有:

字体相关:line-height, font-family, font-size, font-style, font-variant, font-weight, font

文本相关: letter-spacing, text-align, text-indent, text-transform, word-spacing

列表相关:list-style-image,  list-style-position, list-style-type, list-style

还有一个比较重要的:color

其他的还有一些不过不常见,可以不记,用到再查就可以了。

下面是所有的可继承的属性(按字母排序):

azimuth,

border-collapse, border-spacing,

caption-side, color, cursor, 

direction, elevation,

empty-cells,

font-family, font-size, font-style,
font-variant, font-weight, font,

letter-spacing,line-height, list-style-image, list-style-position,
list-style-type, list-style,

orphans, pitch-range,

pitch, quotes, richness,

speak-header, speaknumeral,speak-punctuation, speak, speechrate,
stress,

text-align, text-indent, texttransform,

visibility, voice-family, volume,

whitespace,widows, word-spacing

注意:背景相关的属性是不会被继承的哦。

原文地址:https://www.cnblogs.com/zhilingege/p/6829791.html