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 Product preview card

@sushant2313

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


This is my first ever challenge, so it was quite challenging. But I did it. I had trouble in the beginning on how to align the items the way I wanted. but as I googled couple of things I understood.

Community feedback

Ahmed Bayoumi 6,800

@Bayoumi-dev

Posted

Hey Sushant, Congratulations on completing this challenge... Here are some suggestions:

  • Document should have one main landmark, Contain the component with <main>.
<main>
   <div class="grid">
      //...
   </div>
</main>
  • An img element must have an alt attribute, to provide alternative information for an image if a user for some reason cannot view it.

  • All page content should be contained by landmarks, Contain the attribution with <footer>.

<footer>
   <div class="attribution">
      //...
   </div>
</footer>
  • Use REM for font size, It is a must for accessibility because px in some browsers doesn't resize when the browser settings are changed... See this article ---> CSS REM – What is REM in CSS?

  • I suggest you center the component on the page with Flexbox, by giving the parent element <main> the following properties:

body {
    background-color: hsl(30, 38%, 92%);
    /* margin: 150px;         /* <---- Remove  */
    //...
}
main {       /* <--- Add */
   display: flex;
   justify-content: center;
   align-items: center;
   min-height: 100vh;
 }

.grid {
    background-color: #fff;
    /* margin: 0 auto;         /* <---- Remove  */
    //...
}

Hope this help!... Keep coding👍

Marked as helpful

1

@sushant2313

Posted

@Bayoumi-dev thank you so much. I'll try and do my best .

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