专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > 跨浏览器开发

一个html因为margin加倍导致的有关问题

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
一个html因为margin加倍导致的问题
大家帮我看看这个html页面,ie8,ff都是好的,可就是在ie6中框因为margin加倍而过宽,加display又会导致div错乱,哪位大侠能帮我修改下,谢谢了!!代码如下:

<!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 runat="server">
  <title>无标题页</title>
  <style type="text/css">
#container{
width:960px; 
margin:0 auto;
background:#fff;
overflow:hidden;
}
#header{
width:960px;
height:101px;
float:left;
background-color:Blue;
}
#nav{
width:960px;
float:left;
height:46px;
margin:0 auto;
background-color:Red;
}
#banner{
width:960px;
height:280px;
float:left;
background-color:Black;
}
#center{
width:960px;
_height:735px;
min-height:735px;
float:left;
background-color:Green;
}
#main{
width:958px;
_height:623px;
min-height:623px;
margin:0 0 30px 0;
border:1px solid red;
position:relative;
}
#contant1{
width:898px;
_height:600px;
min-height:600px;
border:1px solid blue;
margin:10px 30px 10px 30px;
}
#c01{
width:819px;
margin:10px 40px 10px 40px;
_height:550px;
min-height:550px;
float:left;
border:1px solid gray;
background-color:White;
}
  </style>
</head>
<body>
  <form id="form1" runat="server">
  <div id="container">
<div id="header"></div>
<div id="nav"></div>
<div id="banner">  
</div>
<div id="center" >
<div id="main">
<div id="top1"></div>
<div id="list" >
<div id="contant1" >
<div id="c01" >
</div>
</div>
</div>
</div>
</div>
   
  </div>
  </form>
</body>
</html>


------解决方案--------------------
#c01{
width:819px;
margin:10px 40px 10px 40px;
_height:550px;
min-height:550px;
float:left;
border:1px solid gray;
background-color:White;
}
把float:left;去掉不就行了
------解决方案--------------------
在浮动的样式里面加个

display:inline;
------解决方案--------------------
ie6如果用float:left;然后margin的话会有双倍间距的。

所以在用float:left;和margin的样式里加个display:inline就成了
------解决方案--------------------
上面的是对的
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: