Doess anyone have any idea on how to fix the code below? This is a horizontal menu using unordered list. I want that whenever I resize the browser to the smallest possible size, the menu will still align in horizontal and never go to the next line or have a line break.
CSS:
/* Center Column - Tab Menu */
#tablist { background-color:#EEEEEE; float:left; width:100%; font-size:10px; text-align:center; }
#tablist ul { background-color:#EEEEEE; margin:0px; padding:0px; list-style:none; }
#tablist li { display:inline; margin:0px; padding:0px; }
#tablist a { color:#FFFFFF; font-weight:bold; float:left; background:url("images_ef/misc/images_ef/centertab_left.gif") top left no-repeat; margin:0px; padding:0px 0px 0px 8px; text-decoration:none; }
#tablist a span { color:#FFFFFF; font-weight:bold; float:left; display:block; background:url("images_ef/misc/images_ef/centertab_right.gif") top right no-repeat; padding:6px 9px 5px 0px; }
/* Commented Backslash Hack hides rule from IE5-Mac \\*/
#tablist a span { float:none; }
/* End IE5-Mac hack */
#tablist a:hover span { color:#004080; }
#tablist a:hover { background-position:0% -35px; }
#tablist a:hover span { background-position:100% -35px; }
#tablist a.current { color:#004080; background-position:0% -35px; }
#tablist a.current span { color:#004080; background-position:100% -35px; }
.tabcontent { display:none; }
I have tried to enclose those HTML in a TD with NOWRAP attribute. It’s OK in IE, the menu doesn’t break when I resize the browser but still problematic in Firefox. I have also tried to have enclose it it fixed table with but got no good result.
Ad display:table-cell to the list also but you will need to re-set it back to inline for ie.
#tablist li { margin:0px; padding:0px; list-style-position:inside; [b]display:table-cell[/b];}
[b]* html #tablist li {display:inline}
[/b]
I’ve used the star selector hack but you would be better off using conditional comments because ie7 will need the display:inline also but doesn’t understand * html.