Repository navigation
Equal Height Cards with Aligned Footers #2860
Ronin-0822
started this conversation in
Showcase
Replies: 1 comment 1 reply
|
@Ronin-0822 I'm using this <div class="grid grid-cols-[repeat(auto-fill,minmax(375px,1fr))] gap-8">
// card
</div>It creates 3 cards for large screen, 2 cards for medium, and 1 card for small regardless the card content, the same row will have same height, but different row could have different height |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I recently had to build a grid layout and needed a group of cards to be the same height with their footers perfectly aligned at the bottom (regardless of how much content was in the body).
After a bit of trial and error with the new card component (which I love but the way), this is the clean setup that solved the problem:
1. The Parent Container
2. The Card Structure
If this is common sense for most of you and I was just overthinking it, feel free to ignore! 😊 But if anyone else hits this same layout hurdle, I hope this snippet helps you out.
All reactions