Something about inherit

Like if set:

div{background-color: transparent;}

So it is apply on all div element.

<div class="test"></div>
.test{background-color: inherit;color: red;}

So the inherit is gets from transparent not? So is added inherit by the browser? Like above? As if not set background-color property but still transparent is apply on div so inherited?


inherit takes the property value from the next property above it. So if the div with the class test was the child of an element that did have a background colour set, then it would inherit that colour, whereas the other divs would have a transparent background