title: How can I select all the li that doesn't have ul
body: <p>What I want to do is select <code>&lt;li&gt;</code> not having inside <code>&lt;ul&gt;</code>.</p>
  
  <p>I tried with the selector above but it does not work.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.level1:not(:has(ul)) {
    background: red;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul&gt;
    &lt;li class="level1"&gt;Link1&lt;/li&gt;
    &lt;li class="level1"&gt;Link2
      &lt;ul&gt;
        &lt;li&gt;Link2&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>