I'm at my wit's end!
The container div I'm dealing with is 1170px
wide. My goal is to fit in 3 divs within this width. The first div is 275px
wide, the second is 580px
wide, and the third is also 275px
wide. Altogether, these divs should add up to a total width of 1130px
.
No matter how much I adjust the width of the container div, I just can't seem to get that third div to align on the same line as the other two. It keeps dropping down.
My brain is on the verge of exploding from frustration. Please, someone help!
Sample HTML code:
<div class="container">
<div class="row">
<div class="grid">
<div class="grid-item">
<img src="img/portfolio1.jpg" alt="">
</div>
<div class="grid-item width-double">
<img src="img/portfolio2.jpg" alt="">
</div>
<div class="grid-item">
<img src="img/portfolio3.jpg" alt="">
</div>
</div>
</div>
</div>
CSS snippet:
.grid {
.grid-item {
padding: 0;
width: 275px;
height: 275px;
float: left;
&.width-double {
width: 580px;
}
&.height-double {
height: 580px;
}
}
}
Javascript function:
$grid.isotope({
itemSelector: '.grid-item',
layoutMode: 'masonry'
});
Check out the code here: http://codepen.io/anon/pen/meORoL