I'm using "column-count" to create a grid of items aligned upward to each others ("column-gap: 0px
").
It looks great but the problem starts when I try to implement infinite scrolling.
I'm adding another grid with the same structure below the first but can't align it to the items of the first grid.. creating some unwanted gaps between section.
is there any option on alignment to objects above?
I only found the vertical-align standard option that doesn't really help me.
This is how it looks: (items have different heights)
.itemsSection{
line-height: 0;
-webkit-column-count: 3;
-webkit-column-gap: 0px;
-moz-column-count: 3;
-moz-column-gap: 0px;
column-count: 3;
column-gap: 0px;
}
.item{
height: auto;
border: 1px solid #DDD;
border-radius: 2px;
margin-bottom: 10px;
display: inline-block;
vertical-align: text-top;
padding: 3%;
margin: 2%;
}
<div id="allItems">
<div class="itemsSection">
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
</div>
<div class="itemsSection">
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
</div>
<div class="itemsSection">
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
<div class="item">...</div>
</div>
</div>