Reputation: 43
I'm having some trouble with html/css positioning in what is some sort of a menu. I have a ul element with a number of child li elements. Each of these li elements contains another ul element. So for example there is something like this:
<ul class="level0">
<li id="nav-1-1" class="level1"><span> Option1 </span>
<ul id="submenu" class="">
<li class="level2" first="" nav-2-2="">
<li class="level2" first="" nav-2-2="">
<li class="level2" first="" nav-2-2="">
</ul>
</li>
<li id="nav-1-1" class="level1"><span> Option2 </span>
<ul id="submenu" class="">
<li class="level2" first="" nav-2-2="">
<li class="level2" first="" nav-2-2="">
<li class="level2" first="" nav-2-2="">
</ul>
</li>
This is just an example. What I would like is to position the inner ul element to the outer, and not the li. How can this be done? Thanks in advance.
Upvotes: 0
Views: 984
Reputation: 3366
make the outer ul position: relative;
and then the inner ul position: absolute;
then you can position it whereever you want to according to the outer ul.
still don't really see the point in this as you can position it absolute also to the parent li elemennt.
Upvotes: 1