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

Austinā€¢ 310

@Absynthee

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


Frontend Mentor - Blog preview card

This is my first submission to Frontend Mentor! I am new to using github, haven't used javascript before and I'm extremely rusty with CSS, so these challenges will hopefully help me improve my skills in the frontend space.

Any feedback on this task would be greatly appreciated!

Extras

  • added keyframe animation to the box-shadow on hover.

Thanks!

Community feedback

Daniel šŸ›øā€¢ 44,230

@danielmrz-dev

Posted

Hello @Absynthee!

Your project looks great!

I have one suggestion for you to improve it even more:

  • Although it works, using position: absolute is not the best option to center an element. It can cause bugs and may result in part of the content being cut off on smaller screens.

Here's a very efficient (and better) way to place an element in the middle of the page both vertically and horizontally:

šŸ“Œ Apply this to the body (in order to work properly, don't use position or margins):

body {
    min-height: 100vh;
    display: flex;  /* it works with grid too  */
    justify-content: center;
    align-items: center;
}

I hope it helps!

Other than that, great job!

Marked as helpful

1
Chiragā€¢ 370

@chirag-bishnoi

Posted

Hello @Absynthee, you have created the card very nicely but the problem I see is that it stars shrinking way before the screen touches it. This is because you have given your body position absolute. If you want to center the card then give your html and body height of 100%. Then just just flexbox. Remove position absolute as well as transform. Also, instead of giving width:340px to main element use max-width:340px.

For comparison you can check out my project for this. Hope it helps :)

Marked as helpful

1

Austinā€¢ 310

@Absynthee

Posted

@chirag-bishnoi Thank you for the feedback! Very helpful indeed. :)

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