开发者

arrange groups of similar elements in two columns

If my HTML says something along the following

开发者_StackOverflow中文版<div class="container">
 <div class="element">
 </div>
 <div class="element">
 </div>
 [...]
 <div class="element">
 </div>
</div>

is it then possible to align those elements as if they were in a two-column table? I.e. with 7 elements there would be 4 rows, with the last row only having one element.

(The elements themselves have NO special classes or ids like right,left,etc.)


Yes:

.container{ position: relative }
.element{ width: 50%; float: left }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜