一个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就成了
------解决方案--------------------
上面的是对的
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
ie6下png图片透明色解析为灰色,如何解决?
<div class="Self-navigation">
<ul>
<li><a href="#" class="login-li">登录...
-
.net 如何载入页面
是这样的,页面分为 1 、top.aspx 2、middle.aspx 3、buttom.aspx
现在就是在index.aspx 不知道如何引用top.asp...
-
ie下面序号只有1
<html>
<head>
<meta charset="gb2312" />
<style>
li {
width:100px;
height:20px;
border:1px dashed red;
}...
-
谈谈Javascript那些操蛋的事(一)?
1. 永远不要写function _name(){…}的形式,要养成var _name=function(){}的习惯。
“Javascri...
-
求解:这个程序为什么只能在ie中正常显示,其他的浏览器都显示不了
<td width="806" valign="top" >
<table width="100%" border="0...
-
Chrome中Margin 的问题
为什么设置的margin值,和实际的margin值,有1px的差别?
这是我设置的值
element.style {
margin-left: 10px;
...
-
關於facebook的奇怪問題
經過很久很久的折騰 我居然發現了這個問題
首先是大家找一個http連接的地址
隨便一個網址 自己加上url=...
-
用VB,VC 写的现有桌面软件,如何做成嵌入到WEB页面那样?
看到一些网站,可以在线编辑WORD文档
也看到一些产品,当然是能连上互联网...
-
关于CAS单点登录的SSL证书问题
最近老大让我实现几个系统的单点登录,我想用CAS实现单点登录,请教一下,SSL证书必须使用吗?如果是公司...
-
动态网页和静态网页的区别
各位大侠:
百度百科,定位动态网页有以下几点:
(1)动态网页一般以数据库技术为基础,可以大大降...