I have multiple divs creating a grid pattern on my page. The width of each div is set with bootstrap to all equally be the same in this case the class 'col-md-3' is added to make each 25% of the width of the page. Each div is either 400px or 800px in height. This is where I am having a problem.
According to this question sollution 5 is what I need to do to achieve the required effect: Bootstrap row with columns of different height
I have followed the second demo however, I have no errors and I still have an offset in my Grid pattern, can someone please advise?
I have noticed that position absolute has been added to each div, his is making them layer on top of each other instead of being in the grid?
<div class="blockOut row">
<div class="col-md-3 blocks short">
</div>
<div class="col-md-3 blocks short">
</div>
<div class="col-md-3 blocks tall">
</div>
<div class="col-md-3 blocks short">
</div>
<div class="col-md-3 blocks short">
</div>
<div class="col-md-3 blocks tall">
</div>
<div class="col-md-3 blocks short">
</div>
<div class="col-md-3 blocks short">
</div>
</div>
.blockOut {
margin-top: 7.5vh;
}
.blocks {
cursor: pointer;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
transition: .5s ease-in-out;
}
$( document ).ready(function() {
$('.row').masonry({
itemSelector : '.col-md-3'
});
});