div:not(.wayne) div:not(.garth) .content {
background-color:red;
}
<div class="wayne">
<div class="content">Party On Garth</div>
</div>
<div class="garth">
<div class="content">Party On Wayne</div>
</div>
<div class="Saitama">
<div class="content">One punch.</div>
</div>
<div class="Naruto">
<div class="content">Dattebayo</div>
</div>
The background should be red unless the class is either .garth
or .wayne
. How can I do this for all .content
?
Saitama and Naruto should have red backgrounds. Right now nothing has a red background. Any similarly added new characters should also have a red background.
Pseudocode
if(!(wayne || garth)){ apply red background to .content}
I'm willing to use JavaScript if necessary. I prefer css.