Monztter
KPCKevin Powell - Community
•Created by foulmace on 4/1/2024 in #front-end
I NEED HELP WITH CREATING CARDS WITH CSS(using flexbox or grids)
I usually tackle this with using flex-grow. Check out this codepen I whipped up for you: https://codepen.io/MattBudz/pen/qBwVVNg
Notice the card-body has
display: flex;
and then the card-description has flex-grow: 1
This ensures that the height of all your cards is even with everything above and below the card description maintaining a consistent position in all cards regardless of the height of the description.
You can apply the flex-grow to the card-title element also if you anticipate your titles will vary in height.21 replies