gpt4 book ai didi

CSS - li 元素在 IE 中无法正确显示

转载 作者:行者123 更新时间:2023-11-28 14:02:32 25 4
gpt4 key购买 nike

我在 IE(8) 中显示 li 元素时遇到问题,它在 FF 中看起来正是我想要的。

IE 在元素底部留出 4px 的边距。这是代码。我可以通过向元素添加 -4px 边距来移除边距,但随后它会在 FF 中缩小它。

所以基本上 IE 让我的 li 变胖了。

#navigation ul {
width: 176px;
margin: 0px 1px 2px 0px;
padding: 0px 0px 0px 0px;
list-style: none;
-webkit-box-shadow: inset 0px 0px 4px 4px #000001;
-moz-box-shadow: inset 0px 0px 4px 4px #000001;
box-shadow: inset 0px 0px 4px 4px #000001;
border: 1px solid white;
-webkit-border-radius: 0px 0px 10px 10px;
-moz-border-radius: 0px 0px 10px 10px;
border-radius: 0px 0px 10px 10px;
float: left;
}
#navigation li {
height: 30px;
}
#navigation li:hover {
background: none;
-webkit-box-shadow: inset 0px 0px 4px #000;
-moz-box-shadow: inset 0px 0px 4px #000;
box-shadow: inset 0px 0px 4px #000;
}
#navigation li:last-child {
-webkit-border-radius: 0px 0px 10px 10px;
-moz-border-radius: 0px 0px 10px 10px;
border-radius: 0px 0px 10px 10px;
}
#navigation ul li a {
display: block;
padding: 8px 8px 8px 8px;
font: bold 12px Helvetica;
color: #444;
text-decoration: none;
border-bottom: 1px solid #999;
border-top: 1px solid #FFF;
}
#navigation ul li a:hover {
color: blue;
}
#navigation ul li:first-child a {
border-top: none;
}
#navigation ul li:last-child a {
border-bottom: none;
}

li 元素的背景代码(其中很多 - 就像图像拼图):

#c1l1 { background: url(img/new-1-0-0-0-01-02.png);}
#c1l2 { background: url(img/new-1-0-0-0-01-03.png);}

有什么建议吗?

最佳答案

尝试设置display: inline;<li>元素。当然,仅适用于 IE(为此使用条件注释)。

关于CSS - li 元素在 IE 中无法正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10205319/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com