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 review - Card

Ralph 190

@RalphPastel972

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?

Just happy that I am making progress.

I used for the first time:

  • CSS variables
  • local fonts
  • Hover pseudo element
  • Firefox Devtool (better than the chrome one)

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

installing the fonts was a bit challenging. Still not sure I did it by the book.

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

n/a

Community feedback

Daniel 🛸 44,230

@danielmrz-dev

Posted

Hello there!

Congrats on completing the challenge!

Your project is looking fantastic!

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

  • Using margin isn't always the most effective method for centering an element.

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

1

Ralph 190

@RalphPastel972

Posted

@danielmrz-dev Thank you very much ! I really appreciate that. I will definitely use that tip.

Update: I just tried and tested it and it is definitely a good practice and I am grateful you and @kodan96 gave it to me. Thank you guys

1
P
Koda👹 3,810

@kodan96

Posted

hi there! 👋

You can center your content with Flexbox if you apply these to the body tag:

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

Hope this was helpful 🙏

Good luck and happy coding! 🙌

Marked as helpful

0

1of1baw 160

@1of1baw

Posted

thx u it helpful @kodan96

1
Ralph 190

@RalphPastel972

Posted

Thank you very much for the tips. I'll try that.

I admit I do not understand the reason you added the following line, though:

min-height: 100vh;

Could you explain?

Warm thanks again for the feedback. really appreciate it.

0

1of1baw 160

@1of1baw

Posted

thx @RalphPastel972

0
P
Koda👹 3,810

@kodan96

Posted

@RalphPastel972

when your content doesn't take up 100vh (one screen height) it 'doesn't know' how high it is, the minimum size where centering works with layout tools is 100vh, so you just apply it to the body tag and boom. the reason why you should use min-height and not height is to make sure users can scroll down on smaller screens if your content overflows on that size. height would prevent that and users wouldn't be able to see the overflowing content.

Marked as helpful

0
Ralph 190

@RalphPastel972

Posted

@kodan96

Thank you so much! I'll definitely use that tip from now on.

1

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