1

I want to select all li which not contains a tag in css:

ul.sf-menu li:not(a)

But looks like it is not working.

Need help

<ul class="sf-menu sf-js-enabled sf-shadow">
    <li>
        <a href="/ ">
    </li>
    <li> need to select this li because it is not contains a href
        A 
        <ul style="visibility: visible; display: block">
            <li>
                <a href="/B-1">
            </li>
            <li>
                <a href="/B-2">B-2</a>
            </li>
         </ul>
      </li>
 <li>

jason
  • 379
  • 1
  • 8
  • 18
  • This question is also a duplicate, see http://stackoverflow.com/questions/2000582/css-selector-for-foo-that-contains-bar – Niko Sep 19 '11 at 07:25
  • possible duplicate of [Is there a CSS parent selector?](http://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector) – thirtydot Sep 19 '11 at 11:36
  • You don't need a parent selector (which is what you're asking for) here. Though I'm not sure what the answer is, because you've not described your *actual problem* - you've simply asked how to select a certain element. – thirtydot Sep 19 '11 at 11:38
  • css4 supports these sorts of selectors. – chovy Oct 22 '11 at 23:58