Okay so as the title says I've been trying to use the inherit
keyword with the h1
's that have the class called "special
" but it doesn't work as long as I decide to use id
's on them. Can anyone please explain me why?
<div class="container">
<h1>Just a text wrapped inside heading-1 tag</h1>
<h1 class="special">Just a text wrapped inside heading-1 tag</h1>
<h1>Just a text wrapped inside heading-1 tag</h1>
<h1>Just a text wrapped inside heading-1 tag</h1>
<h1 class="special">Just a text wrapped inside heading-1 tag</h1>
</div>
Below is the styling
<style>
.container {
color: blue;
}
.container h1{
color: green;
}
.special {
color: inherit;
}
</style>