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

pvkom26's Perfume Card with mobile-first approach

pvkom26 50

@pvkom26

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


Is it OK to turn the <body> element into a flex for a challenge like this? Just to center the card? Or would it be better to wrap the card into a <div> for that?

Also, if the card is the <main> element and it gets wrapped into a <div>, would it be more semantically correct to make the wrapper <main> and turn the card into a regular <div>? I doubt it but want to see what the community thinks.

Love this website, helps me a lot!

Community feedback

Gideon 440

@GiDDeRo

Posted

This is a nice solution.

  1. Actually yeah, you could do that. Look at it this way, you are gonna be saying (coding), the body to center its element. And the only and main element is the card. Even tho, what you gonna do about the footer, if the card is all wrapped in a div. Personally, I think you done a great job

  2. Depending on your approach. Personal preference: But since the card is literally the "main" element, another <div> container wouldn't be needed. Yunno, it gives the code simplicity and clarity.

Happy coding

Marked as helpful

1

pvkom26 50

@pvkom26

Posted

@GiDDeRo thanks for the feedback. Really appreciate it!

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