What is the purpose of the INHERIT value in CSS if a child inherits it's parents characteristics by default? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

What is the purpose of the INHERIT value in CSS if a child inherits it's parents characteristics by default?

I'm going through the CSS courses and I'm really really new into HTML and web design, but this thing is bothering me. I mean, is there a scenario where the inherit value might prove useful considering that it tells the browser to do something that it already does by default? It's more of a curiosity because I have absolutely 0 experience with web development, so please don't be salty.

18th Apr 2019, 3:34 PM
George Roșca
George Roșca - avatar
1 Answer
+ 1
IT's useful sometimes. Imagine wanting to change the color of every p tag but one. You could select them via classes, but is easier to set the color of every p tag and the changing the color of the one p tag to inherit or another color. Inherit can also be used when working with grids for setting widths and heights of collumns.
18th Apr 2019, 9:20 PM
Bela Brockmann
Bela Brockmann - avatar