打印

[求助] 这个div在ie7正常,但ie6不正常,我已经看过多次但解决不了,麻烦版主看一下

如题,在ie7正常





但在ie6不正常







我不知道错误在哪?麻烦版主看下,谢谢
附件: 您所在的用户组无法下载或查看附件,您需要注册/登录后才能查看!
刚才下下来随便看了一下文件,楼主的CSS文件里面用了28个左浮动,但是就是没见过一个清除浮动的标签,呵呵........ (浮动了后要记住清除哦!


CSS样式:

@charset "gb2312";
/* CSS Document */
body,th,td{
margin:0px;
padding:0px;
font-size:13px;
color:#060933;
border-collapse:collapse;
}

/**************瀹瑰櫒*********************/
.box{
float:left;
width:950px;
height:350px;
}



.boxcenter{
float:left;
width:950px;
height:350px;
margin-right:2px;
}







/************时政新闻********************/
.box2{
float:left;
width:950px;
height:350px;
margin-bottom:5px;
padding:0px;
}

/********左边********/
.box2left{
float:left;
width:350px;
height:350px;
margin-right:5px;
}

.box2left1{
float:left;
width:348px;
height:198px;
margin-bottom:5px;
border:1px solid #bbc3d5;
}

/*********今日头条**********/
.toutiaotitle{
float:left;
width:348px;
height:15px;
FILTER: progidXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f9fbfe,endColorStr=#d6e3f3);
padding-top:5px;
color:#FF0000;
font-weight:bold;
}

.toutiaocontent{
float:left;
width:350px;
height:180px;
}
/*****国内头条***************/
.toutiaocontentleft{
float:left;
width:175px;
height:180px;
}

.touleftpic{
float:left;
width:150px;
height:90px;
margin:10px;
}

.touleftwenzi{
float:left;
width:150px;
height:70px;
margin-left:10px;
text-indent:2em;
}

.touleftwenzi a:link{
font-size:13px;
color:#004080;
text-decoration:none;
}

.touleftwenzi a:visited{
font-size:13px;
color:#00172F;
text-decoration:none;
}

.touleftwenzi a:hover{
color:#060933;
text-decoration:underline;
}

.toutiaocontentright{
float:left;
width:175px;
height:180px;
}

.tourightpic{
float:left;
width:150px;
height:90px;
margin:10px;
}

.tourightwenzi{
float:left;
width:150px;
height:70px;
margin-left:10px;
text-indent:2em;
}

.tourightwenzi a:link{
font-size:13px;
color:#004080;
text-decoration:none;
}

.tourightwenzi a:visited{
font-size:13px;
color:#00172F;
text-decoration:none;
}

.tourightwenzi a:hover{
color:#060933;
text-decoration:underline;
}
/******社会新闻****************/
.box2left2{
float:left;
width:350px;
height:15px;
margin-bottom:5px;
}

/******高层动态***************/
.box2left3{
float:left;
width:348px;
height:123px;
border:1px solid #bbc3d5;
}

.gaocengtitle{
float:left;
width:348px;
height:15px;
padding-top:5px;
font-weight:bold;
color:#FF0000;
FILTER: progidXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f9fbfe,endColorStr=#d6e3f3);
}

.gaocengcontent{
float:left;
width:348px;
height:103px;
margin-top:2px;
}

.gaocengcontent2{
float:left;
width:348px;
height:15px;
margin-top:2px;
}

.gaocengcontent2 a:link{
font-size:13px;
color:#004080;
text-decoration:none;
}

.gaocengcontent2 a:visited{
font-size:13px;
color:#00172F;
text-decoration:none;
}

.gaocengcontent2 a:hover{
color:#060933;
text-decoration:underline;
}
/*******中间************/
.box2center{
float:left;
width:240px;
height:350px;
margin-right:5px;
}

/*****社会热点**********/
.box2center1{
float:left;
width:238px;
height:253px;
margin-bottom:5px;
border:1px solid #bbc3d5;
}

.shehuititle{
float:left;
width:238px;
height:15px;
padding-top:5px;
FILTER: progidXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f9fbfe,endColorStr=#d6e3f3);
font-weight:bold;
}

.shehuicontent{
float:left;
width:238px;
height:233px;
color:#663300;
}

.shehuicontent2{
float:left;
width:237px;
height:15px;
margin-top:2px;
padding-left:1px;
}

.shehuicontent2 a:link{
font-size:13px;
color:#004080;
text-decoration:none;
}

.shehuicontent2 a:visited{
font-size:13px;
color:#00172F;
text-decoration:none;
}

.shehuicontent2 a:hover{
color:#060933;
text-decoration:underline;
}

.box2center2{
float:left;
width:240px;
height:90px;
}
/********右边**************/
.box2right{
float:left;
width:350px;
height:350px;
}


.box2right1{
float:left;
width:348px;
height:203px;
margin-bottom:5px;
border:1px solid #bbc3d5;
}


/******图片新闻*******/
.box2right2{
float:left;
width:348px;
height:138px;
border:1px solid #bbc3d5;
}

.pictitle{
float:left;
width:348px;
height:15px;
padding-top:5px;
FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#f9fbfe,endColorStr=#d6e3f3);
}

.pic{
float:left;
width:90px;
height:105px;
margin:10px;
}

.pic1{
width:90px;
height:90px;
}

.pic2{
width:90px;
height:13px;
text-align:center;
padding-top:2px;
}

.pic2 a:link{
font-size:13px;
color:#004080;
text-decoration:none;
}

.pic2 a:visited{
font-size:13px;
color:#00172F;
text-decoration:none;
}

.pic2 a:hover{
color:#060933;
text-decoration:underline;
}
XHTML--CSS(Web标准)联盟 QQ群:6258367
楼上的真有耐心,向你学习
我也经常遇到这种问题

TOP

还在为头像烦恼?还在为不能关注好友动态烦忧?快来蓝色理想家园吧!
从哪写清除浮动?(这语句从来没写过 )

TOP

应该是浮动和宽度设置引起的,因为IE6和IE7为了向后兼容,存在双重的解析标准, 区别在于顶部的DTD声明;

[ 本帖最后由 zoloadang 于 2008-6-19 09:25 编辑 ]

TOP

反正我都是一看有不对劲的地方,就来一句clear:both

TOP

对照修改

77行       width:170px;
82行       /*float:left;*/
85行       margin:10px auto;
120行       /*float:left;*/
123行       margin:10px auto;
115行       width:170px;
272行       width:342px;
279行       width:100%;
289行       width:100%;
296行       widith:100%;
306行       回车,然后输入display:inline;/*解决ie6浮动加倍错误*/

删除html文件第25行的<div class="toutiaocontentright">
然后删除28行任意一个</div>
XHTML+CSS

TOP

你的div用的太泛滥了,改了一下,样式合并进来了

 提示:您可以先修改部分代码再运行
XHTML+CSS

TOP

我看到你们写的有点奇怪,全部都是用DIV标签来写的,一点HTML的标答都没用到,太浪费了!
而且代码套的太多了,看起来比较累,只是个人观点!

TOP

回复 leeyoug 在 10# 的帖子

同意楼上的意见,呵呵,他们确实太DIV啦! 很纯很暴力
XHTML--CSS(Web标准)联盟 QQ群:6258367

TOP

做任何事情都是一样的吧应该一味的用div比如你要实现一个标题
那你用h标签有时候可以省掉很多的代码最起码你不用设置加粗了
你说是不是啊!

TOP