I have searched for solutions to my issue with centering isotope on my project, but none of the existing answers were sufficient. I am facing challenges trying to center isotope without creating extra space between its elements and arranging them in a specific order (like the one with 300x460 dimensions) as shown in the images below. Although I attempted to use margin-left to move it to the center, the elements ended up sticking together.
Here's the snippet of my HTML and CSS work so far:
<div class="portfolio">
<div class="container">
<div class="portfolio-gallery">
<div class="row grid">
<div class="col-md-3 grid-item">
<img src="assets/images/placeholdit300x260.png">
</div>
<div class="col-md-3 grid-item grid-item--width2">
<img src="assets/images/placeholdit300x220.png">
</div>
<div class="col-md-3 grid-item">
<img src="assets/images/placeholdit300x310.png">
</div>
<div class="col-md-3 grid-item">
<img src="assets/images/placeholdit300x200.png">
</div>
<div class="col-md-3 grid-item">
<img src="assets/images/placeholdit300x460.png">
</div>
<div class="col-md-3 grid-item">
<img src="assets/images/placeholdit300x370.png">
</div>
<div class="col-md-3 grid-item">
<img src="assets/images/placeholdit300x200.png">
</div>
</div>
</div>
</div>
</div>
.portfolio{
padding-top: 64px;
padding-bottom: 77px;
}
.portfolio .portfolio-gallery{
margin: 60px auto;
}
.portfolio .grid-item{
margin-bottom: 20px;
}