Inheritance
noun
say it: “in-HAIR-ih-tuns” /ɪnˈhɛrɪtəns/
In CSS, the way some properties, mostly text ones such as color and font, pass from an element to everything inside it, while box properties such as border and padding don't.
What is inheritance in CSS?
Inheritance means some properties, like color and font-family, pass down from a parent element to the elements inside it.
.article { color: #333; font-family: Georgia, serif; }
/* every paragraph and link inside .article gets that color and font */
In a sentence
- “I set the font once on the body, and inheritance carried it to every paragraph and heading on the page.”
Level: Novice · More CSS terms at this level
Updated