I have some nested <ul>
s and I want them to be the same height: the height of the tallest one. I cannot specify the height of any <ul>
since it depends on the amount of <li>
s in it.
I figure I could solve this pretty easy using some js, but I am curious if this could be fixed using CSS.
I created a simple fiddle to demo: http://jsfiddle.net/vnFLK/2/
<nav>
<ul>
<li>Li 1
<ul>
<li>Sub 1</li>
<li>Sub 2</li>
</ul>
</li>
<li>Li 2
<ul class="green">
<li>Sub 1</li>
<li>Sub 2</li>
<li>Sub 3</li>
</ul>
</li>
</ul>
</nav>
The <ul>
with green borders is supposed to determine the height of the root <ul>
and then I want the sibling <ul>
to get the same height. The green <ul>
is pushed 200% to the right just to be clearer.
This is a simplified representation of a navigation where a <ul>
is a submenu that is going to be pulled over the parent one. Therefore they need to be the same height to prevent the parent menu being shown.
/Erik