3 回答


TA貢獻(xiàn)1858條經(jīng)驗(yàn) 獲得超8個(gè)贊
.box:nth-child(odd){ clear:both;}
nth-child(3n+1)

TA貢獻(xiàn)1111條經(jīng)驗(yàn) 獲得超0個(gè)贊
left
.right
.
#holder{
width:200px;
border:1px dotted blue;
display:inline-block;
}
.box{
width:100px;
height:150px;
background-color:#CCC;
float:left;
text-align:center;
font-size:45px;
}
.one{
background-color:#0F0;
height:200px;
}
.two{
background-color:#0FF;
}
.three{
background-color:#00F;
float:right;
}
.four{
background-color:#FF0;
float:right;
}
.left{float:left;}
.right{float:right;}
<div id="holder">
<div class="box one left">1</div>
<div class="box two left">2</div>
<div class="box four right">4</div>
<div class="box three right">3</div>
</div>
</body>
添加回答
舉報(bào)