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

HTML , CSS

@KerolosLotfy

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 did you find difficult while building the project? => Put the card exactly in the middle of the body. Which areas of your code are you unsure of? => media query

Community feedback

Gastón 40

@GasstonTorres

Posted

Hi there! I read that you had some issues centering the card. There are several ways to do it, but im gonna tell you what i did.

<main> <section class="card-container"> </section> <main>

the container is the card itself. i set up <main> in css like this: main { width: 100vw; height: 100vh; display: flex; justify content: center; align items: center; }

The display Flex in <main> make that all its child elements (container) set up with justify content and align items in center, center the card perfectly.

i hope that i helped you.

Marked as helpful

0

@VCarames

Posted

Good job!

Everything you have in your body is correct in order to center your card, you just forgot to add min-height: 100vh; and remove margin-top.

What part of the media query are you unsure of?

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