Use quote marks to find an "exact phrase"

Print version

print icon

17: Inheritance

Inheritance

Some property values are inherited from an ancestor. This is known as 'inheritance'. For example, if you give a container element a value for 'color', then any text within the container will inherit that value. This applies not just to the children of the container, but all descendants of whatever generation.

Inheritance only applies to some properties, and many of them are lesser-used types beyond the scope of this course. (Visit the W3C website for the complete list of properties that do and do not inherit values.) Of the properties that are relevant here, most relate to paragraph text and lists:

Inheritance is often used to set default styling for these properties.