我有一个在 IE 8 和 Chrome 中都正确显示的 CSS 菜单。然而,在 Firefox 中,似乎添加了额外的填充并将最后一个菜单项推到下一行。
任何人都可以看看下面的内容并告诉我如何解决它。
下面的CSS:
#wrap {
width: 920px;
margin: 0 auto;
}
#cssmenu{
border:none;
border:0px;
margin:0px;
padding:0px;
font: 67.5% 'Lucida Sans Unicode', 'Bitstream Vera Sans', 'Trebuchet Unicode MS', 'Lucida Grande', Verdana, Helvetica, sans-serif;
font-size:10px;
font-weight:bold;
}
#cssmenu ul{
background:#333333;
height:37px;
list-style:none;
margin:0;
padding:0;
border-bottom: 3px solid #2580a2;
}
#cssmenu li{
float:left;
padding:0px;
}
#cssmenu li a{
background:#333333 url('images/seperator.gif') bottom right no-repeat;
color:#cccccc;
display:block;
font-weight:normal;
line-height:37px;
margin:0px;
padding:0px 22px;
text-align:center;
text-decoration:none;
}
#cssmenu li a:hover, #cssmenu ul li:hover a{
background: #2580a2;
color:#FFFFFF;
text-decoration:none;
}
#cssmenu li ul{
background:#333333;
display:none;
height:auto;
padding:0px;
margin:0px;
border:0px;
position:absolute;
width:225px;
z-index:200;
/*top:1em;
/*left:0;*/
}
#cssmenu li:hover ul{
display:block;
}
#cssmenu li li {
background:url('images/sub_sep.gif') bottom left no-repeat;
display:block;
float:none;
margin:0px;
padding:0px;
width:225px;
}
#cssmenu li:hover li a{
background:none;
}
#cssmenu li ul a{
display:block;
height:35px;
font-size:10px;
font-style:normal;
margin:0px;
padding:0px 10px 0px 15px;
text-align:left;
}
#cssmenu li ul a:hover, #cssmenu li ul li:hover a{
background:#2580a2 url('images/hover_sub.gif') center left no-repeat;
border:0px;
color:#ffffff;
text-decoration:none;
}
#cssmenu p{
clear:left;
}
下面的 HTML:
<html>
<head>
<link href="menu_assets/styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrap">
<div id='cssmenu'>
<ul>
<li><a href='index.html'><span>HOME</span></a></li>
<li class='has-sub'><a href='#'><span>OPERATIONS</span></a>
<ul>
<li><a href='#'><span>Product 1</span></a></li>
<li class='last'><a href='#'><span>Product 2</span></a></li>
</ul>
</li>
<li><a href='#'><span>AIRWORTHINESS</span></a></li>
<li><a href='#'><span>REGULATIONS AND POLICY</span></a></li>
<li><a href='#'><span>MANUALS AND FORMS</span></a></li>
<li><a href='#'><span>EDUCATION</span></a></li>
<li><a href='#'><span>ABOUT CASA</span></a></li>
<li id='cssmenulast'><a href='#'><span>SERVICES</span></a></li>
</ul>
</div>
</div>
</body>
</html>