This is my code:
The problem is - main <li>
becomes wider, because <ul>
inside has more text.
How can I fix it?
This is my code:
The problem is - main <li>
becomes wider, because <ul>
inside has more text.
How can I fix it?
尝试这个
ul#mainmenu > li:hover > ul
{
display: block;
position:absolute;
}
这对您来说可能是一个足够好的解决方案:
ul#mainmenu > li
{
display: inline-block;
margin: 0;
vertical-align: top;
width:50px;
}
ul#mainmenu > li > ul
{
display: none;
margin-left:-40px;
width:200px;
}
和你的 jsFiddle: JsFiddle