I've encountered an issue while attempting to create a grid template layout - there seems to be an unexpected column gap appearing on the right side. Any suggestions on how I can get rid of this?
For reference, you can view the problem at this link (notice the extra column gap on the right): https://i.sstatic.net/pPKNU.png
Below is the HTML and CSS code I am using:
.container {
width: 100%;
max-width: 1920px;
margin: auto;
}
.img-gallery {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: auto;
grid-column-gap: 30px;
grid-template-areas: 'img-1 img-2 img-3';
}
.img-gallery div {
width: 100%;
height: 300px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
<div class="container">
<div class="img-gallery">
<div class="img-1" style="background-image: url(images/img-1);"></div>
<div class="img-2" style="background-image: url(images/img-2);"></div>
<div class="img-3" style="background-image: url(images/img-3);"></div>
</div>
</div>