one way you can solve it is by adding line-height: 0
to the a
and setting the height
value with px
value.
section {
display: flex;
flex-flow: row wrap;
justify-content: center;
}
section a {
flex: auto;
line-height: 0;
}
section img {
height: 300px;
width: 100%;
object-fit: cover;
}
Controlling flex growability