我怎样才能改变这个网格布局,使第二行块位于其上方相应块的正下方,而不是形成一个全新的行?
http://jsfiddle.net/AndyMP/wSvrN/
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
#container {
position: absolute;
width: 60%;
left: 50%;
margin-left: -30%;
border: 1px dotted #333;
padding: 20px;
}
.box1 {
position: relative;
float: left;
width: 100px;
height: 150px;
background: #666;
margin: 0 15px 15px 0;
}
.box2 {
position: relative;
float: left;
width: 100px;
height: 200px;
background: #666;
margin: 0 15px 15px 0;
}
.box3 {
position: relative;
float: left;
width: 100px;
height: 100px;
background: #666;
margin: 0 15px 15px 0;
}
HTML
<div id="container">
<div class="box1"></div>
<div class="box3"></div>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box2"></div>
<div class="box1"></div>
<div class="box1"></div>
<div class="box3"></div>
<div class="box2"></div>
</div>