开发者

How to make div stack first vertically then horizontally? [duplicate]

开发者 https://www.devze.com 2023-04-02 12:58 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to stack divs from top to bottom in CSS
This question already has answers here: Closed 11 years ago.

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

0

精彩评论

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