So I have CSS like this:
#blogPosts{ -moz-column-count: 3; -moz-column-gap: 10px; -webkit-column-count: 3; -webkit-column-gap: 10px; column-count: 3; column-gap: 10px; width: 100%; }
and this creates 3 columns perfectly but when I gain another row the order seems to come out vertically like:
1,3,5 2,4,6
Instead of what I am wanting as:
1,2,3 4,5,6
Another important attribute I need, is that there must be a set margin between every post vertically. So for example if you look at the table above if 2
is longer than 1
, the top of 4
will start y
bellow 1 rather than: the height of 2
+ y
.
The HTML is like this:
<div id="blogPosts"> <div class="blog">Content</div> <div class="blog">Content</div> ... </div>
What can I do to fix this?
I am happy for any solutions, even one that includes javascript/jquery
This is the kind of thing I am after
Use grid-row-start , grid-row-end , grid-column-start , grid-column-end , or their shorthands, grid-row and grid-column , to set a grid item's size and location in the grid.
To move columns to the right, use the . col-*-offset-* class in Bootstrap.
The closest thing would be to use flexbox
#blogPosts { display: flex; align-items: left; justify-content: left; flex-direction: row; flex-wrap: wrap; flex-flow: row wrap; align-content: flex-end; }
http://jsfiddle.net/o59gc4hw/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With