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

Stats Display Component

Micah Sellsā€¢ 100

@Micahtron

Desktop design screenshot for the Stats preview card component 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 been dabbling with Frontend Mentor for a while now, but only on my local computer. This is my first time doing a push using modern (post 2015) CSS practices. this is also my first public push to GitHub; figured I'd use this basic project as a test drive for other challenges.

Also I made a point to time myself and keep it short. Overshot the timeframe but learned quite a bit about debugging image styling (i.e. that un-asked for whitespace at beneath an image).

Now that I have the process down I'll run a few other timed basic challenges before moving on to full complex templates.

Community feedback

Daniel šŸ›øā€¢ 44,230

@danielmrz-dev

Posted

Hello, @Micahtron!

Your project is looking fantastic!

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

Using margin and/or padding 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
P
Laila Benā€¢ 180

@Laila-front-dev

Posted

hello @Micahtron

  • nice work, your project is great.
  • in the body you can use code
       display: flex ;
       justify-content: center;
      align-items: center;
      flex-direction: column;
      min-height: 100vh;
    
0
Micah Sellsā€¢ 100

@Micahtron

Posted

Hey Daniel, Thank you for your help! Getting "demo divs" to behave in the past has always involved a bit of janky CSS.

I've already implemented your advice in another challenge and it works far easier. Thanks.

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