继承了哪些 CSS 属性? [英] Which CSS properties are inherited?
本文介绍了继承了哪些 CSS 属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我注意到有些属性在 CSS 中是继承的,有些则不是.例如,text-size 属性是继承的,但是padding 和margin 不是由子块继承的.那么如何判断哪些属性是继承的,哪些不是呢?
I've noticed that some properties are inherited in CSS, and some are not. For example, the text-size property is inherited, but the padding and margin are not inherited by the child blocks. So how to figure out which properties are inherited, and which are not?
推荐答案
这里是所有可继承属性的列表.我正在处理 W3C 的信息,所以我猜应该是正确的.但是了解网络浏览器(特别是 IE),其中一些可能不是所有浏览器都可以继承的:
Here is the list of all inheritable properies. I'm working with W3C's information, so I'd guess it should be correct. But knowing web browsers (IE specifically), some of these might not be inheritable by all browsers:
方位角
边框折叠
边框间距
字幕端
颜色
光标
方向
海拔
空单元格
font-family
字体大小
字体样式
font-variant
font-weight
字体
字母间距
行高
list-style-image
list-style-position
list-style-type
列表样式
孤儿
音高范围
间距
引用
丰富性
speak-header
说数字
讲标点符号
说
语速
压力
文本对齐
文本缩进
文本转换
可见性
voice-family
音量
空格
寡妇
字间距
这篇关于继承了哪些 CSS 属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文