- 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.
1 Resposta
+ 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.