0

I'm creating a menu in CSS which looks like:

<li id="menuTask" class="menuEntry line">
    <div>
        <div class="imageHolder">
            <img alt="Task" src="Resources/Icons/Task.png" />
        </div>
         <div class="menuItem">Task</div>
     </div>
 </li>
<li id="menuTask2" class="menuEntry line">
    <div class="subMenuHolder>
        <div class="imageHolder">
            <img alt="Task" src="Resources/Icons/Task.png" />
        </div>
         <div class="menuItem">Task</div>
     </div>
 </li>

You'll notice that every menuitem is wrapped inside a LI element. In some cases the DIV under the li element has a class subMenuHolder.

Now I would like to add some padding on the LI element, but only if the child div element does not contain the class subMenuHolder.

Is something like that possible with plain CSS selectors?

I was thinking about using the :not selector, but I don't quite find it.

Complexity
  • 5,682
  • 6
  • 41
  • 84

0 Answers0