I want to make 8 cards on a mobile version of my news site (school project). I wish for the cards to all have the same proportion, but, the images I have saved on my computer for the cards differ some in sizes (some of them are taller).
Is there a way to make the images, headline and text all fit in the cards, without me having to resize every image before adding it to the project?
I wish for all cards to look like this
How the cards look like when the image size differ
Code:
img {
max-width: 100%;
max-height: 100%;
display: block;
}
.cards {
display: flex;
flex-direction: column;
justify-content: space-between;
margin: 5px;
}
.card{
display: flex;
flex-direction: column;
padding: 5px;
margin: 20px;
margin-bottom: 5px;
height: 280px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}