<!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>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
<title>無標題文檔</title>
<style?type="text/css">
.box1{height:50px;background:red;float:left;}
.box2{height:50px;background:blue;float:left;}
.fclear{clear:both;}/*width:100%;overflow:hidden;*/
</style>
</head>
<body>
<p>盒子1盒子1</p>
<div?class="box1">盒子1盒子1</div>
<div?class="box2">盒子1盒子1</div>
<p>盒子1盒子1</p>
<p>盒子1盒子1</p>
</body>
</html>
2015-06-17
不是受影響,是float的特性,你前面的div用了float,后面跟著的元素就會在有空位的時候自動跟上去,這個時候就要清除浮動,在div后面跟上一句<div style="clear:both"></div>,其后面的元素才能正常布局
2015-06-16
很正常啊,受什么影響?