4.11 CSS Inheritance
Now for one last CSS concept in this chapter—inheritance. CSS inheritance is when a CSS property value flows down from a parent element to one or more of its child elements. That should sound familiar. It parallels the inheritance of genetic characteristics (e.g., height and eye color) from a biological parent to a child.
Some CSS properties are inheritable and some are not. To determine whether a particular CSS property is inheritable, go to Mozilla’s list of CSS keywords at https://developer.mozilla.org/en-US/docs/Web/CSS/Reference and click on the property you’re interested in. That should take you to a description of that property, including its inheritability. Of the CSS properties covered so far in this book, here ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access