Add the following CSS:
#menu > ul { white-space: nowrap; } #menu > ul > li { display: inline-block; float: none; margin: 0 -3px 0 0; }
float: none you must override the rule #menu li { float: left; } #menu li { float: left; } which ignores the parent rule ul white-space: nowrap .
display: inline-block creates an inline layout for list items, but still allows them to be treated as block items in relation to size and positioning.
A negative margin-right needed to override the conversion of the string in the default HTML source to one space; without it, your top-level menu items will have spaces between them.
display: inline-block does not work properly in IE7. The fix is ββdescribed here :
to make the inline box work for any element in Internet Explorer, just add "zoom: 1; * display: inline; _height: 30px;" until the end of this style of elements oh and yes change the height to whatever you need.
source share