I’m trying to use grids to display my pictures and make them cover the whole page while not changing aspect ratio. But when I open my page on Firefox or Chrome there’s a huge gap on the right side.
Disposition in VSC browser
Disposition in Firefox or Chrome
I tried :
- setting
margin: 0;
in body - setting
height, width, max-width
in html and body - setting
width: 100%;
in container
.container {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 350px 350px;
gap: 2em;
padding: 1em;
}
.photo {
max-width: 100%;
max-width: 100%;
object-fit: cover;
}
<div class="container">
<div>
<img class="photo" src="Japon_content/000001_minia.jpeg">
</div>
<div>
<img class="photo" src="Japon_content/000002_minia.jpg">
</div>
</div>
2
Answers
I fixed this by applying these styles to the
photo
class:No, the gap is correct…