Internet Explorer中的CSS:list-style-image和float:left问题

时间:2010-09-26 18:06:09

标签: css internet-explorer

我在使用Internet Explorer 8的CSS中使用list-style-image属性时出现问题

如果我设置

li {
 float:left;
 list-style-image: none;
}

每个菜单项都在彼此之上。如果我删除list-style-image:none,它们就完全定位了,但它们有点图像。 (见图片)

alt text alt text

1 个答案:

答案 0 :(得分:1)

由于您将float:left设置为<li/>并设置为内部<a/>,因此列表元素会崩溃。没有必要;从float:left移除<a/>可以解决问题。

对于列表项目符号,如前所述,list-style-type:none是可行的方法。

特别是对于IE8,我还建议删除line-height:0中的#block-menu-primary-links。它可能会导致崩溃行为。

注意:我真的不明白@orokusaki的建议。试过没有position:relative;,它运作得非常好。