【发布时间】:2012-02-01 02:53:45
【问题描述】:
在这种情况下,IE8 和 Chrome 看起来相同,但 Firefox 显示的内容不同:
在 Firefox 中:
在 Internet Explorer 8 中:
在谷歌浏览器中:
为什么最后两个间隔很窄?
这是 HTML:
<ul id="navigation">
<li><a href="@Url.Action("Index", "Home")">HOME</a></li>
<li><a href="@Url.Action("Index", "OurApproach")">OUR APPROACH</a></li>
<li><a href="@Url.Action("Index", "Menu")">MENU</a></li>
<li><a href="@Url.Action("Index", "Contact")">GET IN TOUCH</a></li>
</ul>
这是 CSS,(使用 SCSS):
/* The inconsistency is in the margin-top rule of the UL. */
#navigation { /* This is just a UL element. I used the margin-top, to position it. */
float: left;
list-style-type: none;
margin-left: -16px;
margin-top: 117px;
li {
background-color: #934B00;
@include nav-radius;
color: White;
float: left;
font-size: 14px;
margin-right: 6px;
padding: 5px;
cursor:pointer;
a { text-decoration:none; color:White; }
a:hover { text-decoration:none; color:#904E00;}
a:visited { text-decoration:none; color:White; }
a:link { text-decoration:none; color:White; }
}
li:hover {
color:#904E00;
background-color:#EEA74F;
}
}
【问题讨论】:
-
在 IE8 中,按 F-12 并查看您处于 STANDARDS 模式还是 QUIRKS 模式。如果您处于 QUIRKS 模式,则说明文档类型声明错误。
-
你不能像这样嵌套 CSS 声明。
-
@MattGrande:检查每个“药丸”底部的细长分隔。
-
马特:有一个像素的差异。
-
只显示 CSS 对我们没有任何帮助。
标签: html css cross-browser margin sass