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

Blog Preview Card

Divalady87ā€¢ 50

@Divalady87

Desktop design screenshot for the Blog preview card coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I've just started learning how to code on my own. Watching and following a tutorial is one thing, but having to build something from scratch was a real challenge, but I love that I was able to pull it off!

What challenges did you encounter, and how did you overcome them?

Learning how to get the components all working together to match the design given.

What specific areas of your project would you like help with?

How to center the card in the middle of the page, I'm not quite sure how to do that yet.

Community feedback

Daniel šŸ›øā€¢ 44,230

@danielmrz-dev

Posted

Hello, @Divalady87!

Your project is looking fantastic!

I'd like to suggest a way to make it even better:

Here's a highly efficient approach to position an element at the center of the page both vertically and horizontally:

šŸ“Œ Apply this CSS to the body (avoid using position or margins in order to work correctly):

body {
    min-height: 100vh;
    display: flex; 
    justify-content: center;
    align-items: center;
}

I hope you find this helpful!

Keep up the excellent work!

Marked as helpful

0
Cropsiā€¢ 110

@Cropsii

Posted

To center a card, you can try using the following CSS code:

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

Marked as helpful

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