How can I tell CSS :not() selector to affect all child nodes?
问题 Please see this minimum example .global :not(.guard) { color: red; } <div class="global"> <p>I'm outside guard</p> <div class="guard"> I'm inside guard. <div> <hr> <p> I'm a block inside guard. </p> <p> I want to black color too. </p> <p> How can I achieve it? </p> </div> </div> </div> I have a style(SCSS) like this .global { :not(.guard) { color: red; } } I want anything inside the node with .guard class name's color not to be affected by color: red; How can I achieve this effect? 回答1: If I