我的导航栏居中并在 Firefox 22 和 Chrome 27 中完美运行,但在 IE 8 中无法正常运行,我讨厌成为那个人,但是什么给了?如果一切都很好,那不是很好吗,如果这与工作无关,我不在乎,但我们被困在使用 IE 上。是否有某种资源可用于跨浏览器兼容性,还是只是试水?
CSS 标记
body
{
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
margin: 0;
padding: 0;
}
.container
{
width: 1004px;
margin: 0 auto;
text-align: center;
}
.navigation
{
text-align: center;
display: inline-block;
list-style-type: none;
text-align: center;
}
.navigation li
{
float: left;
width: 150px;
position: relative;
}
.navigation li a
{
color: #fff;
display: block;
padding: 8px 7px 8px 7px;
text-decoration: none;
border-top: 1px solid #F2861D;
background: #262626;
text-align: center;
text-transform: uppercase;
}
.navigation li a:hover
{
color: #F2861D;
}
.navigation ul
{
position: absolute;
left: 0;
display: none;
margin: 0 0 0 -1px;
padding: 0;
list-style: none;
border-bottom: 3px solid #F2861D;
}
.navigation ul li
{
width: 150px;
border-top: none;
}
.navigation ul a
{
display: block;
height: 15px;
padding: 8px 7px 13px 7px;
color: #fff;
text-decoration: none;
border-top: none;
border-bottom: 1px dashed #6B6B6B;
}
.navigation ul a:hover
{
color: #F2861D;
}
HTML 标记
<div class="container">
<div class="navigation">
MY NAVIGATION
</div>
</div>