Inheritance allows child elements to receive some computed styles from parents, reducing repetition in typographic styling.
Often inherited
- Text color and font properties.
- Line-height.
- Some list/text-related properties.
Not inherited by default
Layout properties like margin, padding, border, and dimensions generally do not inherit automatically.
Important interview questions and answers
- Q: Why set typography at
bodylevel?
A: Descendants inherit baseline text styles, reducing duplication. - Q: How to force inheritance when needed?
A: Useinheritvalue deliberately on specific properties. - Q: Inheritance vs cascade?
A: Cascade resolves competing rules; inheritance passes values from ancestors.
Pitfall: Check cascade order—author stylesheet loses to inline styles and !important surprises.