Reputation: 13931
This is my code:
The problem is - main <li>
becomes wider, because <ul>
inside has more text.
How can I fix it?
Upvotes: 0
Views: 39
Reputation: 24766
Try this
ul#mainmenu > li:hover > ul
{
display: block;
position:absolute;
}
Upvotes: 1
Reputation: 918
This may be an good-enough solution for you:
ul#mainmenu > li
{
display: inline-block;
margin: 0;
vertical-align: top;
width:50px;
}
ul#mainmenu > li > ul
{
display: none;
margin-left:-40px;
width:200px;
}
and your jsFiddle : JsFiddle
Upvotes: 0