-2
I have a small problem centering a submenu of a dropdown menu. The following example is quite simple, but it illustrates my problem:
<ul id="menu">
<li>Menu1
<li>Menu2
<ul>
<li>Submenu1
<li>Submenu2
<li>Submenu3 com outras palavras
<li>Submenu4
</ul>
<li>Menu3
</ul>
Preview Jsfiddle. What happens is the following: The submenu in red (within the second UL) is centered in the parented menu, Menu2. However, I do not know if it is correct since I had to adjust the left position of the submenu UL (50%) and LI (-50%).
Everything was centralized, regardless of the size of the menu text, but with one problem: green bg shows that the UL submenu is still in the "wrong position", but only so I can centralize perfectly since I did not want to stipulate a fixed width (in pixels) for submenus.
It is possible to centralize everything, including Sumbenu UL?
That’s not your problem, but don’t forget to close the <li tags>
– Jader A. Wagner
Quiet, hehehe, I left so just to make the code cleaner. Thanks for the reminder.
– Maf3r0