+ -
当前位置:首页 → 问答吧 → IE6下如果宽度超出就会撑开DIV

IE6下如果宽度超出就会撑开DIV

时间:2011-05-18

来源:互联网

这个问题之前论坛里也有提到,但一直没有好得解决方法。http://bbs.blueidea.com/viewthread.php?tid=3020067
我现在也碰到同样的问题。就是IE6下如果宽度超出就会撑开DIV
我就发一下效果图吧。
IE7以上版本正常
1.jpg (67.57 KB)
2011-5-18 14:14


IE6版本不正常
2.jpg (29.82 KB)
2011-5-18 14:14


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.div1{width:400px;}
.div2{width:100px; float:left}
.div3{width:300px; float:right;}
</style>
</head>

<body>
<div class="div1">
<div class="div2">无标题文档</div>
<div class="div3"><img src="http://www.sygdwl.com/uploads/allimg/110518/1135105229-0.jpg" width="750" height="1599" /></div>
</div>
</body>
</html>

作者: glbuo   发布时间: 2011-05-18

.div1,.div2,.div3{overflow:hidden;display:inline;}
加上溢出隱藏,元素變成内聯就可以;另外就是DIV要有寬度的情況下這兩屬性才有效

作者: km268   发布时间: 2011-05-18