I am trying to limit the amount of items I have in a flexbox row, and the solution I see the most is using flex-basis, but that causes the elements to stretch, which I don't want, because the elements are links in the form of images, and the stretching causes the link area to be bigger than the image. Is there a way to do this? Here is my HTML and CSS:
HTML:
<div class="spnsr-main">
<h1 id="spnsr-title">Thank You To Our Sponsors</h1>
<div class="spnsrs">
<a class="spnsr-link" href="link" target="_blank"><img class="spnsr" src="../assets/sponsors/spnsr1.png"></a>
<a class="spnsr-link" href="link" target="_blank"><img class="spnsr" src="../assets/sponsors/spnsr2.png"></a>
<a class="spnsr-link" href="link" target="_blank"><img class="spnsr" src="../assets/sponsors/spnsr3.png"></a>
<a class="spnsr-link" href="link" target="_blank"><img class="spnsr" src="../assets/sponsors/spnsr4.png"></a>
<a class="spnsr-link" href="link" target="_blank"><img class="spnsr" src="../assets/sponsors/spnsr5.png"></a>
</div>
</div>
CSS:
.spnsrs {
display:flex;
justify-content:center;
flex-wrap:wrap;
gap:150px 0px;
}
.spnsr {
max-width:350px;
}
.spnsr-link {
text-align:center;
flex-basis:34%;
}