Could use some assistance with this coding issue:
.element {
border: 1px solid red;
display: block;
}
I want to exclude this rule when .element
is a descendant of .no-border
using the :not
pseudo-selector. For example:
<div class="element">I have a border</div>
<div class="no-border">
<div class="element">I don't have a border</div>
</div>
This is what I have tried:
:not(.no-border) .element {
border: 1px solid red;
display: block;
}
However, the border still shows on .element
when it is within .no-border
.
https://jsfiddle.net/7Lox10pL/1/
Any suggestions or solutions would be greatly appreciated!