Firefox 3.6 和 Firefox 4 之间的水平导航 CSS 差异
在 FF4 中,“联系我们”链接出现在 www 页面顶部水平导航中的“主页”链接下方。 avaline.com(以及该域下的所有页面)。在 FF 3.6 中,它看起来不错并且适合 900px 宽度的 ul 元素。
为了让它在浏览器中更好地工作,我缺少什么?
<ul id="nav2">
<li><a href="/" title="promotional products home">home</a></li>
<li><a href="/Information/Product-Testing-Library" title="product safety">product safety</a></li>
<li><a href="/Current_Specials?loc=top" title="current promotional product specials">current specials</a></li>
<li><a href="/Marketing-Tools/2011-Digital-Catalog-and-Request-Form" title="digital and request catalog">request catalog</a></li>
<li><a href="/Marketing-Tools?loc=top" title="marketing tools">marketing tools</a></li>
<li><a href="/Information/About-Us" title="about us and our promotional products">about us</a></li>
<li><a href="/Contact-Us" title="Contact us about our promotional products">contact us</a></li>
</ul>
#header_top ul#nav2 {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 79px; /* was 80px ll */
width: 900px; /* was 776 ll */
left: 7px; /* was 64px */
font-family: Arial, Helvetica, sans-serif;
}
#header_top ul#nav2 li {
float: left;
font-weight: bold;
padding: 0 23px;
font-size: 11px;
list-style:none;
}
#header_top ul#nav2 li a {
color: #fff;
text-transform: uppercase;
}
#nav3 a, #nav3 a a:link, #nav3 a a:visited, #nav2 li a, #nav2 a a:link, #nav2 li a a:visited, #nav1 li a, #nav1 a a:link, #nav1 li a a:visited {text-decoration: none;}
#nav3 a:hover, #nav3 a:active, #nav2 li a:hover, #nav2 li a:active, #nav1 li a:hover, #nav1 li a:active {text-decoration:underline;} /* ll */
In FF4, the "Contact Us" link appears under my "Home" link in the horizontal navigation at the top of the page at www. avaline .com (and on all pages under that domain). In FF 3.6 it looks fine and fits within the 900px width ul element.
What am I missing to get this to work better across browsers?
<ul id="nav2">
<li><a href="/" title="promotional products home">home</a></li>
<li><a href="/Information/Product-Testing-Library" title="product safety">product safety</a></li>
<li><a href="/Current_Specials?loc=top" title="current promotional product specials">current specials</a></li>
<li><a href="/Marketing-Tools/2011-Digital-Catalog-and-Request-Form" title="digital and request catalog">request catalog</a></li>
<li><a href="/Marketing-Tools?loc=top" title="marketing tools">marketing tools</a></li>
<li><a href="/Information/About-Us" title="about us and our promotional products">about us</a></li>
<li><a href="/Contact-Us" title="Contact us about our promotional products">contact us</a></li>
</ul>
#header_top ul#nav2 {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 79px; /* was 80px ll */
width: 900px; /* was 776 ll */
left: 7px; /* was 64px */
font-family: Arial, Helvetica, sans-serif;
}
#header_top ul#nav2 li {
float: left;
font-weight: bold;
padding: 0 23px;
font-size: 11px;
list-style:none;
}
#header_top ul#nav2 li a {
color: #fff;
text-transform: uppercase;
}
#nav3 a, #nav3 a a:link, #nav3 a a:visited, #nav2 li a, #nav2 a a:link, #nav2 li a a:visited, #nav1 li a, #nav1 a a:link, #nav1 li a a:visited {text-decoration: none;}
#nav3 a:hover, #nav3 a:active, #nav2 li a:hover, #nav2 li a:active, #nav1 li a:hover, #nav1 li a:active {text-decoration:underline;} /* ll */
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它在 Windows7 x64 Home Premium 上运行的 Firefox(v 4.0.1)上看起来很好,
但是,我可以在 IE9 中重现您的“错误”,但是通过将 li 元素的填充更改为 21px(而不是 23px),可以轻松解决此问题)。
jsFiddle: http://jsfiddle.net/KBgKa/5/
It appears fine on my Firefox (v 4.0.1) running on Windows7 x64 Home Premium
I could, however, reproduce your 'bug' in IE9, however this was easily fixed by changing the padding of the li element to 21px ( instead of 23px ).
jsFiddle: http://jsfiddle.net/KBgKa/5/