I have a top horizontal menu that wraps when user zooms in (text or regular) in Firefox and Safari (Windows). If you also zoom OUT in both, every other zoom adjustment it also wraps, too.
The way I made this menu was to:
- pad my links, both left and right so it spreads to right width
- size my text in px not ems or %'s
- set width of it’s container div’s
- use background images that reposition on rollover; first and last links use rounded-corners images;
Is there a better way to do what I’m trying to do?
thanks,
R
code is here:
#preface {
background-image:none;
min-height:0px;
padding-left:0px;
background-color:#fff;
height:41px;
width:960px;
}
#preface-wrapper {
margin:0 auto;
padding:0;
width:960px;
}
#preface div.block ul {
text-align:center;
width:960px;
}
#preface-wrapper div.block ul li.leaf {
background:none;
padding:0;
height:41px;
display:inline;
float:left;
margin:0 1px 0 0;
border-left:1px solid #E1E1E1;
}
#preface-wrapper a:link, #preface-wrapper a:visited {
color:#00a2ff;
font-family:helvetica, sans-serif;
font-size:15px;
font-weight:bold;
text-decoration:none;
padding:3px 42px 3px;
height:35px;
line-height:2.5;
float:left;
background-image: url(images/blue-top-nav-bg-both-copy.jpg);
background-repeat:repeat-x;
}
#preface-wrapper div.block ul li a:hover {
background-color: transparent;
background-position:0 -59px;
background-repeat:repeat-x;
}
#preface-wrapper div.block ul li.first {
background:none;
padding:0;
height:41px;
display:inline;
float:left;
margin:0 1px 0 0;
border:0px solid #f00;
}
#preface-wrapper ul.menu li.first a:link, #preface ul.menu li.first a:visited {
border-left:0px solid #f00;
padding:3px 43px 3px 43px;
background: transparent;
background-image: url(images/blue-nav-bg-lft-top-both.jpg);
background-repeat: no-repeat;
}
#preface-wrapper ul.menu li.first a:hover {
border-left:0px solid #f00;
background-color:transparent;
background-position:0px -59px;
}
#preface-wrapper ul.menu li.last a:link, #preface ul.menu li.last a:visited {
border-left:none;
padding:3px 43px 3px 43px;
background:transparent;
background-image: url(images/blue-nav-bg-rt-top-both.jpg);
background-repeat:no-repeat;
background-position:right top;
}
#preface-wrapper ul.menu li.last a:hover {
border-left:none;
background-color:transparent;
background-repeat:no-repeat;
background-position:right -59px;
}