我在对 div 进行排序时遇到问题,我有两种类型a, b
a - should always be at the front (all a types)
b - should be following all a types.
HTML:
<div class="" style="">
<div class="a">a</div>
<div class="a">a</div>
<div class="b">b</div>
<div class="a">a</div>
</div>
CSS:
.a, .b {
display:inline-block;
width:50px;
height:50px;
padding:15px;
margin:5px;
}
.a {
float:left;
background-color: blue;
}
.b { background-color: red; }
这似乎在一行中工作正常:
但是像网格一样中断:
期望的结果(框数无关):
JsFiddle:http: //jsfiddle.net/kQkn9/
我将如何解决这个问题?