继承了哪些 CSS 属性? [英] Which CSS properties are inherited?

查看:29
本文介绍了继承了哪些 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:

  1. 方位角
  2. 边框折叠
  3. 边框间距
  4. 字幕端
  5. 颜色
  6. 光标
  7. 方向
  8. 海拔
  9. 空单元格
  10. font-family
  11. 字体大小
  12. 字体样式
  13. font-variant
  14. font-weight
  15. 字体
  16. 字母间距
  17. 行高
  18. list-style-image
  19. list-style-position
  20. list-style-type
  21. 列表样式
  22. 孤儿
  23. 音高范围
  24. 间距
  25. 引用
  26. 丰富性
  27. speak-header
  28. 说数字
  29. 讲标点符号
  30. 语速
  31. 压力
  32. 文本对齐
  33. 文本缩进
  34. 文本转换
  35. 可见性
  36. voice-family
  37. 音量
  38. 空格
  39. 寡妇
  40. 字间距

这篇关于继承了哪些 CSS 属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆