Using CSS, I'm trying to target all ul
elements inside the #include
element, except for the ones inside the #exclude
element. Here's the markup:
<div id="include">
<ul><li>Include List</li></ul>
<div id="exclude">
<ul><li>Exclude List</li></ul>
</div>
</div>
I thought I could do this using the :not
CSS selector like this:
#include :not(#exclude) ul {
color: blue !important;
}
The result I'm seeing is that neither ul
gets the blue color. Clearly I am misunderstanding how this :not
selector works. Is what I'm trying to do possible? Here's a fiddle: