Inheritance

Inheritance is the mechanism by which certain CSS properties, mostly text-related ones (color, font-family, line-height), are passed from parent elements to children. Others, like margin or border, are not. inherit forces inheritance, and initial restores the default value.

Example

body { font-family: sans-serif; color: #222; }

Related concepts

The whole glossary