marcus1060
08-06-2010, 05:36 PM
Here's an example of what I'm trying to accomplish.
<div id="sidebar">
<ul id="menu">
<li>Item 1
<ul>
<li>Child 1</li>
<li>Child 2</li>
<li>Child 3</li>
</ul>
</li>
<li>Item 2</li>
<li>Item 3
<ul>
<li>Child 1</li>
<li>Child 2</li>
</ul>
</li>
</ul>
<div id="another-element"></div>
<div id="another-another-element"></div>
</div>
#sidebar {
width:200px;
}
#menu li ul {
display:none;
}
#menu li ul:hover {
display:block;
}
What I want to happen though, is I want to keep the items following the menu in the same position even if the child elements of the list are being displayed.
So the menu would overlap over top of the bottom elements.
I can do this easily in Javascript, I would just like to know if it's possible in HTML/CSS.
Thank you.
<div id="sidebar">
<ul id="menu">
<li>Item 1
<ul>
<li>Child 1</li>
<li>Child 2</li>
<li>Child 3</li>
</ul>
</li>
<li>Item 2</li>
<li>Item 3
<ul>
<li>Child 1</li>
<li>Child 2</li>
</ul>
</li>
</ul>
<div id="another-element"></div>
<div id="another-another-element"></div>
</div>
#sidebar {
width:200px;
}
#menu li ul {
display:none;
}
#menu li ul:hover {
display:block;
}
What I want to happen though, is I want to keep the items following the menu in the same position even if the child elements of the list are being displayed.
So the menu would overlap over top of the bottom elements.
I can do this easily in Javascript, I would just like to know if it's possible in HTML/CSS.
Thank you.