CSS导致UL在IE中缩进过多 [英] CSS causing an UL to be indented too much in IE

查看:201
本文介绍了CSS导致UL在IE中缩进过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面顶部有一个导航栏。在FF和Chrome导航栏显示精细。然而在IE8(有或没有兼容性)UL似乎缩进从左手边,而不是每个li只是整个li;尽管声明

I have a navigation bar at the top of a page. In FF and Chrome the navigation bar displays fine. However in IE8 (with or without compatibility) the UL seems to indent from the left hand side, not each li just the whole li; despite declaring

text-align:center; width:600px; margin:auto; padding-left:0;

任何想法可能会导致什么?

Any ideas what could be causing this?

推荐答案

margin-left:0px;

在Firefox中,默认填充UL,在IE中它有左边距。

In Firefox the UL is padded left by default, in IE it has a left margin.

示例:

<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>

这篇关于CSS导致UL在IE中缩进过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆