I want to color all my p in blue, except the one inside the no-color div.
I tried p:not(.no-color), :not(.no-color) p, div:not(.no-color) p but I think I misunderstand something
p:not(.no-color) {
color: blue;
}
<div class="container">
<p>Lorem ipsum</p>
<div class="no-color"><p>Lorem ipsum</p></div>
<p>Lorem ipsum</p>
<div class="random-class"><p>Lorem ipsum</p></div>
</div>
Edit: The HTML code is retrieved automatically, so I can't choose on which elements I apply the classes. I can only stylize in CSS.
.no-color p {..}p{..}.no-color p{color: blue}body, this would work though:body > p { color: blue; }