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

Componente de cartão de visualização do produto

Lucass151 50

@Lucass151

Desktop design screenshot for the Product 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?

All

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

Img

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

All

Community feedback

@SvitlanaSuslenkova

Posted

body { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; } Try this to align(top-bottom) and justify(left-right) your project to the center. It applies to the parent component(body). You can use grid instead of flex too(with some changes). Hope you found this comment helpful :)

Marked as helpful

0

@TedJenkler

Posted

Hi @Lucass151,

Nice project! Another way to center an element is to set the parent to position: relative and the card to position: absolute. Then, you can use top: 50% and left: 50% with transform: translate(-50%, -50%) to center it perfectly. I would typically use Flexbox in most cases, but this method is a quick alternative when you just need to center an element and also works well if you want the card to overlap or be positioned in a specific way.

Continue the great work!

Best, Teodor

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