How to make a div stack vertically and then horizontally first?

Possible duplicate:
How to fold a div from top to bottom in CSS

When I have some adjacent divs with float:left , they add up like this:

  _______ | 1 2 3 | | 4 5 | |_______| 

I need a stack:

  _______ | 1 4 | | 2 5 | |_3_____| 

jsFiddle horizontal laying

How to achieve vertical styling?

+6
source share
1 answer

@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; } 

See my example here for more. How to fold a div from top to bottom in CSS

read this article for more http://www.quirksmode.org/css/multicolumn.html

+5
source

Source: https://habr.com/ru/post/896703/


All Articles