I have two div elements:
<div class = "clsdiv1">Hello</div>
<div class = "clsdiv2">Bye</div>
and those css classes:
.clsdiv{
background: red;
}
.clsdiv1 {
background: black;
border: 2px solid black;
}
.clsdiv2 {
background: green;
border: 2px solid white;
}
I want the clsdiv1 and clsdiv2 inherit background color from clsdiv class,so I implement it this way:
.clsdiv1 .clsdiv{
background: inherit;
border: 2px solid black;
}
.clsdiv2 .clsdiv{
background: inherit;
border: 2px solid white;
}
But inheritance not working,any idea what I'm missing? Why inheritence not working?