div背景图片间隙
时间:2011-04-06
来源:互联网
             DIV布局页面时,上下两个DIV(p6和p7)的图片之间有间隙(IE6下有,FF下正常),做网页设计的帮忙解决一下。。。
页面代码:
HTML code
CSS代码:
body,div,img{
padding:0;
margin:0;
}
#main{
margin:0 auto;
width:960px;
height:720px;
}
#p1{
margin:0 auto;
width:960px;
height:48px;
background:url(img/t1_01.gif) no-repeat;
}
#p2{
width:83px;
height:672px;
background:url(img/t1_02.gif) no-repeat;
float:left;
}
#p3{
width:787px;
height:440px;
/*细切*/
}
#p4{
width:787px;
height:232px;
background:url(img/t1_05.gif) no-repeat;
}
#p5{
width:90px;
height:672px;
background:url(img/t1_04.gif) no-repeat;
float:left;
}
#p6{
width:787px;
height:15px;
background:url(img/t1_01_01.jpg);
}
#p7{
width:787px;
height:425px;
background:url(img/t1_01_02.jpg) no-repeat;
float:left;
}
#contxt{
width:787px;
height:672px;
float:left;
}
.both{
clear:both;
}
            页面代码:
HTML code
<body> <div id="main"> <div id="p1"> </div> <div id="p2"> </div> <div id="contxt"> <div id="p3"> <div id="p6"> </div> <div id="p7"> </div> </div> <div id="p4"> </div> </div> <div id="p5"> </div> </div> </body>
CSS代码:
body,div,img{
padding:0;
margin:0;
}
#main{
margin:0 auto;
width:960px;
height:720px;
}
#p1{
margin:0 auto;
width:960px;
height:48px;
background:url(img/t1_01.gif) no-repeat;
}
#p2{
width:83px;
height:672px;
background:url(img/t1_02.gif) no-repeat;
float:left;
}
#p3{
width:787px;
height:440px;
/*细切*/
}
#p4{
width:787px;
height:232px;
background:url(img/t1_05.gif) no-repeat;
}
#p5{
width:90px;
height:672px;
background:url(img/t1_04.gif) no-repeat;
float:left;
}
#p6{
width:787px;
height:15px;
background:url(img/t1_01_01.jpg);
}
#p7{
width:787px;
height:425px;
background:url(img/t1_01_02.jpg) no-repeat;
float:left;
}
#contxt{
width:787px;
height:672px;
float:left;
}
.both{
clear:both;
}
作者: AK_Fish 发布时间: 2011-04-06
             是不是图片的问题,img/t1_01_01.jpg有15px高的内容吗            
            作者: hongmei85 发布时间: 2011-04-06
  引用 1 楼 hongmei85 的回复:
是不是图片的问题,img/t1_01_01.jpg有15px高的内容吗
是不是图片的问题,img/t1_01_01.jpg有15px高的内容吗
有的...787 * 15 px
作者: AK_Fish 发布时间: 2011-04-06
  引用 1 楼 hongmei85 的回复:
是不是图片的问题,img/t1_01_01.jpg有15px高的内容吗
是不是图片的问题,img/t1_01_01.jpg有15px高的内容吗
IE6有间隙,FF下却是好的。
作者: AK_Fish 发布时间: 2011-04-06
             你把margin设为0看有没有用。            
            作者: dehong 发布时间: 2011-04-06
  引用 4 楼 dehong 的回复:
你把margin设为0看有没有用。
你把margin设为0看有没有用。
都有。。
body,div,img{
padding:0;
margin:0;
}
作者: AK_Fish 发布时间: 2011-04-06
 相关阅读 更多  
      
    热门阅读
-   office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具 office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具阅读:74 
-   如何安装mysql8.0 如何安装mysql8.0阅读:31 
-   Word快速设置标题样式步骤详解 Word快速设置标题样式步骤详解阅读:28 
-   20+道必知必会的Vue面试题(附答案解析) 20+道必知必会的Vue面试题(附答案解析)阅读:37 
-   HTML如何制作表单 HTML如何制作表单阅读:22 
-   百词斩可以改天数吗?当然可以,4个步骤轻松修改天数! 百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!阅读:31 
-   ET文件格式和XLS格式文件之间如何转化? ET文件格式和XLS格式文件之间如何转化?阅读:24 
-   react和vue的区别及优缺点是什么 react和vue的区别及优缺点是什么阅读:121 
-   支付宝人脸识别如何关闭? 支付宝人脸识别如何关闭?阅读:21 
-   腾讯微云怎么修改照片或视频备份路径? 腾讯微云怎么修改照片或视频备份路径?阅读:28 















