Home >Web Front-end >CSS Tutorial >Which CSS Properties Are Inherited by Child Elements?

Which CSS Properties Are Inherited by Child Elements?

Susan Sarandon
Susan SarandonOriginal
2024-12-13 22:53:18892browse

Which CSS Properties Are Inherited by Child Elements?

Identifying Inherited CSS Properties

CSS properties govern the visual attributes of web elements. Some of these properties are inherited by child elements, while others are not. Determining which properties are inherited can be crucial for maintaining consistent styling throughout a document.

The World Wide Web Consortium (W3C) has specified a comprehensive list of inheritable properties in CSS 2.1. According to this list, the following properties are inherited:

  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

It's important to note that while this list is comprehensive, certain browsers may not support all the specified properties. Therefore, it's advisable to test the inheritance of properties before implementing them in actual projects.

The above is the detailed content of Which CSS Properties Are Inherited by Child Elements?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn