在html中的css样式,子元素从父元素继承属性,是不是指标签里会继承上一级标签的属性

例:<div style="color:red;"><p>123456<p></div>
那么123456是不是红色

是红色

css样式表属性可以继承的有如下:
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
温馨提示:内容为网友见解,仅供参考
第1个回答  2014-12-29
在P标签没有定义颜色的时候,是继承父元素的红色。
第2个回答  推荐于2018-05-10
这个是红色的,如果你在全局定义里p单独有定义颜色,那么可能就不是红色了。本回答被提问者和网友采纳
第3个回答  2014-12-29
那么123456是红色