Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive 3-column preview card layout using CSS Grid

@iqra0001

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Are the cards completely responsive? What are some of the best ways to center a div horizontally as well as vertically?

Community feedback

@didyouseekyng

Posted

Hey bro, How you doing? You've done a great work attempting this challenge.

.cards{ display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

  1. I think this gap of 20px is not necessary on the card as a whole, so the card1, card2 and card3 would merge.

  2. I also noticed that on mobile, the cards don't have a margin which I suggest you add.

  3. From what I learnt from a few mentors here on FEM, I think the display:flex, align-items: center, justify-content: center and min-height: 100vh does the centering trick. You can apply it to the body or the card. Just work your way around and see which one works well for your code.

  4. Also learnt from others too that it's not best practice to actually have more than one h1 tag in your code. I do hope you find this helpful. Cheers bro! Anticipating your feedback.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord