What I want to do is select <li> not having inside <ul>.
I tried with the selector above but it does not work.
.level1:not(:has(ul)) {
background: red;
}
<ul>
<li class="level1">Link1</li>
<li class="level1">Link2
<ul>
<li>Link2</li>
</ul>
</li>
</ul>
`?