I'd like to apply the green
background
to paragraphs with classes and the red
one to all the others. I've made it half way through but still struggling with empty classes class=""
:
p {background:green}
#test p:not([class]) {
background: red;
color: #fff;
}
<div id="test">
<p>This should be red</p>
<p class="abc">This should be green</p>
<p class="newname">This should be green</p>
<p class="">This should be red</p>
<p class="anothername">This should be green</p>
<p>This should be red</p>
<p class="">This should be red</p>
</div>
Anyone knows a way?