I have the following HTML structure building out my menu:
<div id=”navigation”>
<ul>
<li class=”level1”>Top Level Menu item
<div class=”sublevel”>
<ul>
<li class=”level2”>Second Level Item1
<ul>
<li class=”level3”>Third Level Item1</li>
<li class=”level3”>Third Level Item2</li>
<li class=”level3”>Third Level Item3</li>
</ul>
</li>
<li class=”level2”>Second Level Item2
<ul>
<li class=”level3”>Third Level Item4</li>
<li class=”level3”>Third Level Item5</li>
<li class=”level3”>Third Level Item6</li>
</ul>
</li>
</ul>
</div>
</li>
</ul>
</div>
In CSS I am applying a style to the level 2
class like so:
#navigation .level1 ul li {
background: #acacac;
padding-bottom: 40px !important;
border-radius: 10px;
position: absolute;
}
The problem is that this is applied to all the child menu items as well. How can I specify to only apply this to the level2
items and not the level3
?
I have attempted a variety of >
and +
flags per CSS docs, but no luck.