CSS Inheritance in Practice

Inheritance simply means that in certain cases a child element can inherit properties from the parent element. You can think of it like a default value for certain types of elements and its properties.

It is a common practice to set general text formatting on the body. Paragraphs will inherit those properties even several levels down, unless you don’t overwrite it at some level.

Links inherit the text size and font family, but they keep their default color and text decoration unless you specifically overwrite them.

Headings will inherit the font family and most related text properties, but they are bold by default. You will have to manually overwrite it if you need to.

The following two tabs change content below.

Jay Galaczi

Latest posts by Jay Galaczi (see all)

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *