How to make div stack first vertically then horizontally? [duplicate]
Possible Duplicate:
How to stack divs from top to bottom in CSS
When i have mult开发者_如何转开发iple adjacent divs with float:left
, they stack like this:
_______
| 1 2 3 |
| 4 5 |
|_______|
I want a stack like this:
_______
| 1 4 |
| 2 5 |
|_3_____|
jsFiddle with the horizontal stacking
How can i achieve vertical stacking ?
@ pinouchon; for this type of layout you can use css3 column-count property
for this.
CSS:
div#multicolumn1 {
-moz-column-count: 2;
-moz-column-gap: 10px;
-webkit-column-count: 2;
-webkit-column-gap: 10px;
column-count: 2;
column-gap: 10px;
}
Check my example here for more How to stack divs from top to bottom in CSS
read this article for more http://www.quirksmode.org/css/multicolumn.html
精彩评论