I'm having some difficulty keeping my responsive grid totally square. I tried setting dimensions for the images as a means to control the dimension of the div closer to be square but that didn't work like I thought it would.
What follows is what I'm working with right now. As you can see, on very wide displays the dimensions are more square and on narrower displays the images are very tall and distorted (eg not square).
.one {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 1em;
grid-auto-rows: minmax(100px, auto);
}
.one img {
object-fit: cover;
object-position: center;
height: 480px;
width: 100%;
}
.one h3 {
background-color: pink;
color: black;
font-weight: 700 !important;
padding: 0.5em;
margin: 0;
}
<div class="one">
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
<div>
<h3>
Title
</h3>
<img src="https://i.imgur.com/9gH79q1.jpg" />
<p>
Some description text
</p>
</div>
</div>
What can I do to keep the cell/divs, title and all, totally square?