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

responsive design, flex, padding, display:none

Rozan-A 240

@Rozan-A

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


I will be glad to know your feedback thanks in advance ^-^

Community feedback

_nehal💎 6,710

@NehalSahu8055

Posted

Hello Coder 👋.

Congratulations on successfully completing the challenge! 🎉

Few suggestions regarding design.

➨ Replace height with min-height in your .parent to fix background issues and use flex or grid to properly center the card don't use margin or padding for the same.

➨ Remove paddings from the .parent as this will not dynamically center the card .

➨ To properly center the container.

  • USING FLEXBOX
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
  • USING GRID
body{
min-height: 100vh;
display: grid;
place-items: center;
}

➨ Use Semantics for the proper design of your code.

<body>
<header>
<nav>...</nav>
</header>
<main>...</main>
<footer>...</footer>
wrap up `.attribtution` div inside your footer.
</body>
  • Every site must have one h1 element describing the main content of the page.

  • So, Add a level-one heading instead of p to improve accessibility.

  • <h1>Gabrielle Essence Eau De Parfum</h1>

  • It would be better if you use source media for switching to screen sizes(mobile or desktop) for image.

<picture>
<source media="(min-width:800px)" srcset="yourimage.jpg">
<img src="yourimage.jpg" alt="description">
</picture>
  • For non-decorative images give meaningful and descriptive alt like alt= "Gabrielle Chanel Perfume bottle surrounded by leaves.".

  • Use responsive units(rem, em, %) from next project. Explore respective use cases on google.

  • Replace width with max-width to make your card more responsive.

link.

I hope you find this helpful.

Happy coding😄

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