Firefox 中的 CSS 水平导航栏对齐问题
我的导航栏在 Firefox 和 Opera 中关闭。文本下方的填充明显多于上方。我已经多次更改代码来尝试解决此问题,因此如果当前代码中存在错误,我深表歉意。在 Safari 和 Chrome 中看起来不错。任何人都可以帮助找到我的错误吗?
CSS:
ul {
list-style-type: none;
margin: 0px;
padding: 0px;
margin-bottom: 50px;
}
li {
display: inline;
margin:0;
padding:0;
}
a.one:link,a.one:visited {
font-size: 18px;
line-height: 18px;
font-weight: bold;
background-color: red;
color: white;
font-family: Helvetica,Arial,san-serif;
text-align: center;
padding: 5px 7px;
text-transform: uppercase;
text-shadow: 0.05em 0.05em 0.1em #333;
letter-spacing: 1px;
}
HTML:
<nav>
<ul>
<li><a class=one href=index.html>home</a></li>
<li><a class=one href=bio.html>bio</a></li>
<li><a class=one href=news.html>news</a></li>
<li><a class=one href=disc.html>discography</a></li>
<li><a class=one href=contact.html>contact</a></li>
</ul>
</nav>
谢谢!
My navigation bar is off in Firefox and Opera. There is noticeably more padding below the text than above. I've changed my code so many different times trying to fix this, so I apologize if there are errors in my current code. It looks fine in Safari and Chrome. Can anyone help find my error(s)?
CSS:
ul {
list-style-type: none;
margin: 0px;
padding: 0px;
margin-bottom: 50px;
}
li {
display: inline;
margin:0;
padding:0;
}
a.one:link,a.one:visited {
font-size: 18px;
line-height: 18px;
font-weight: bold;
background-color: red;
color: white;
font-family: Helvetica,Arial,san-serif;
text-align: center;
padding: 5px 7px;
text-transform: uppercase;
text-shadow: 0.05em 0.05em 0.1em #333;
letter-spacing: 1px;
}
HTML:
<nav>
<ul>
<li><a class=one href=index.html>home</a></li>
<li><a class=one href=bio.html>bio</a></li>
<li><a class=one href=news.html>news</a></li>
<li><a class=one href=disc.html>discography</a></li>
<li><a class=one href=contact.html>contact</a></li>
</ul>
</nav>
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是这样的:
margin:0;
和margin-bottom: 50px
,所以上/下比例为 0px/50px比较默认样式表:
WebCore(Safari): html.css
Mozilla(Firefox):html.css
Blink(Chromium/Opera): html.css
Internet Explorer 用户代理样式表
和查找供应商扩展:
Here is the issue:
margin:0;
andmargin-bottom: 50px
is set, the above/below ratio is 0px/50pxCompare the default stylesheets:
WebCore(Safari): html.css
Mozilla(Firefox): html.css
Blink(Chromium/Opera): html.css
Internet Explorer User Agent Style Sheets
And lookup the vendor extensions: