I need something for a dynamic project, and what I want is to make a class that every header element takes some properties, the children can be or not be direct descendants, however, inside that class can be another class that must overwrite the first class properties... I want those classes to be nested like 3-4 times.... is there a way to do this, to not take too much css space?
.something1 h1{
color: green;
}
.something2 h1{
color: red;
}
<div class='something1'>
<div>
<h1>Green</h1>
</div>
<div class='something2'>
<h1>Red</h1>
<div class='something1'>
<div><div>
<h1>Green</h1>
</div></div>
<div class='something2'>
<div>
<h1>Red</h1>
</div>
</div>
</div>
</div>
</div>