CSS导致UL在IE中缩进太多

14 html css internet-explorer html-lists

我在页面顶部有一个导航栏.在FF和Chrome中,导航栏显示正常.然而在IE8中(有或没有兼容性),UL似乎从左侧缩进,而不是每个li只是整个li; 尽管声称

text-align:center; width:600px; margin:auto; padding-left:0;
Run Code Online (Sandbox Code Playgroud)

可能导致这种情况的任何想法?

MyI*_*hin 22

margin-left:0px;
Run Code Online (Sandbox Code Playgroud)

在Firefox中,默认情况下UL被填充,在IE中它具有左边距.

例:

<html>
<head>
<style>

ul{
border:1px solid red;
margin:0px;
list-style:none;
padding:0px;
}

li{
border:1px solid green;
margin:0px;
}

</style>
</head>
<body>

<ul>
<li>this</li>
<li>that</li>
<li>these</li>
<li>those</li>
</ul>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)


Ste*_*Jr. 15

我刚用过ul {list-style-position:outside; 修复IE中的缩进.