落伍者站长论坛's Archiver

oldlee 发表于 2008-7-4 13:47

大家帮我看下这段代码为什么在FF下正常IE下却不正常

谢谢了.[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>xxxx</title>
<style type="text/css">
<!--
*{
        margin:0;
        padding:0;
        list-style-type:none
}
.logo{
        width: 430px;
        margin-top: 120px;
        margin-left: 285px;
        text-align:center;
}
.lists{
        width: 430px;
        margin-top: 20px;
        margin-left: 285px;
        border: 1px dotted #CCCCCC;
        height:100px;
}
.lists ul{
        margin-left: 0px;
}
.lists li{
        margin-left:10px;
        margin-top:10px;
        text-align:center;
        overflow:hidden;
        list-style-type: none;
        float:left;
        width:130px;
        background-color: #99CC66;
        padding-top: 8px;
        padding-bottom: 8px;
}
.lists li a:link{
        font-size: 14px;
        width:130px;
        color: #000000;
        text-decoration: none;
}
.lists li a:visited{
        font-size: 14px;
        width:130px;
        color: #000000;
        text-decoration: none;
}
.lists li a:hover{
        font-size: 14px;
        width:130px;
        color: #006600;
        text-decoration: underline;
        font-style: italic;
        font-weight: bold;
        background-color: #99CC00;
}

Div {
        font-size: 14px;
}
-->
</style>
</head>
<body>
<div class="logo"><img src="img/logo.gif" /></div>
<div class="lists">
<div>
  <ul>
    <li><a href="#">XXXXXX</a></li>
    <li><a href="#">XXXXXX</a></li>
    <li><a href="#">XXXXXX</a></li>
    <li><a href="#">XXXXXX</a></li>
    <li><a href="#">XXXXXX</a></li>
    <li><a href="#">XXXXXX</a></li>
  </ul>
  </div>
</div>

</body>
</html>
[/code]

oldlee 发表于 2008-7-4 14:01

解决了
浮动后本来外边距10px,但IE解释为20px,解决办法是加上display:inline

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.