Archived topic
Is there a way I can set a max width for a single submenu item?
3 replies · Started by Piet Hein on November 20, 2018
Hi guys,
I've installed WPML plugin on my website to translate. When you hover over the flag in the top corner of the main menu, the English or Dutch flags shows as a submenu item.
However, the submenu item is very wide - small flag, wide green background, doesn't look good. (I don't know if this makes sense, but you'll understand if you look on the background.)
I want to fix this by (preferably) setting a max width to this particular menu item, (there are other submenu items that do need the normal width) or by making the background transparent.
However, I don't know how to do this. I can change the colour, but when I set it to transparent it remains green. Is there a smart way to do this, or should I set the colour of all submenu background items to transparent, and then add the colour green to the ones that need the colour?
Kind regards,
Piet
Hi there,
try this CSS:
.main-navigation li.wpml-ls-menu-item > ul {
width: auto;
}
Thanks, David.
Works like a charm.
Cheers,
Piet
Glad i could help