小编典典

哪些CSS属性是继承的?

css

我注意到有些属性是在CSS中继承的,而有些则不是。例如,text-size属性是继承的,但是padding和margin不被子块继承。那么如何确定哪些属性是继承的,哪些不是?


阅读 614

收藏
2020-05-16

共1个答案

小编典典

这是所有可继承属性的列表。我正在使用W3C的信息,所以我认为它
应该 是正确的。但是了解网络浏览器(特别是IE)后,其中一些可能并非所有浏览器都可以继承:

  1. azimuth
  2. border-collapse
  3. border-spacing
  4. caption-side
  5. color
  6. cursor
  7. direction
  8. elevation
  9. empty-cells
  10. font-family
  11. font-size
  12. font-style
  13. font-variant
  14. font-weight
  15. font
  16. letter-spacing
  17. line-height
  18. list-style-image
  19. list-style-position
  20. list-style-type
  21. list-style
  22. orphans
  23. pitch-range
  24. pitch
  25. quotes
  26. richness
  27. speak-header
  28. speak-numeral
  29. speak-punctuation
  30. speak
  31. speech-rate
  32. stress
  33. text-align
  34. text-indent
  35. text-transform
  36. visibility
  37. voice-family
  38. volume
  39. white-space
  40. widows
  41. word-spacing
2020-05-16