Not Found
Not Found
Your session has expired please log in again.
Your session has expired please log in again.
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 NFT-Preview card

@Feyisara2306

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What is the best method of centering the whole page content? Feedbacks are welcome! Thanks.

Community feedback

jimmy 200

@jimmyhachem

Posted

  1. in the body : 'display:flex; justify-content: center; align-items: center; height: 100vh' , But you would have to correct the width and height of the 'wrapper'.

  2. Put everything in a div and add 'display:flex; justify-content: center; align-items: center; , width: 100%.

  3. in the wrapper : 'position: relative , left:50% , top:50% , transform: translate(-50% , -50%)'

Hope this helps :)

Marked as helpful

0
Fatlind Shehu 2,230

@fatlindshehu

Posted

Hi @Feyisara2306,

To my opinion the best method for centering a div/component is using flexbox:

  • display: flex to set the div/component as a flex container.
  • justify-content: center to center the div/component horizontally.
  • align-items: center to center the div/component vertically.
  • Make sure the div/component has a height.
  • If you’re unfamiliar with flexbox, I would suggest checking THIS
  • I would suggest measuring heights/widths & paddings/margins with more precision, using a tool like FIGMA or Adobe XD

Keep up the good work!

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