How to make column fill rows first in css3?

I use (number of columns: 4) in css3 to put 9 images in 4 columns (which counts here: http://css-tricks.com/seamless-responsive-photo-grid/ )

but in my case 9 images just correspond to 3 columns (3 in each column) and the last column is empty! how can i make it fill the lines first?

+7
source share
1 answer

column-fill: balance should do what you want, but this does not work in real browsers.

Maybe multicol is not suitable for you. Depending on what you are trying to do, maybe flexbox, or just an inline block can shorten it?

http://jsbin.com/nobosu/1/edit?css,output

Maybe this is a little closer to what you were trying to do: http://jsbin.com/nobosu/edit?html,css,output

Without specifics, it’s a little difficult to know what to write out.

0
source

All Articles