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 shopping card with flex css

Peter Wahu 190

@Pe-te-r

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 hard difficulty in styling the mobile view but finally i made it

Community feedback

@0xabdulkhaliq

Posted

Hello there 👋. Congratulations on successfully completing the challenge! 🎉

  • I have other recommendations regarding your code that I believe will be of great interest to you.

BODY MEASUREMENTS 📐:

  • Use min-height: 100vh for body instead of height: 100vh. Setting the height: 100vh may result in the component being cut off on smaller screens.
  • For example; if we set height: 100vh then the body will have 100vh height no matter what. Even if the content spans more than 100vh of viewport.
  • But if we set min-height: 100vh then the body will start at 100vh, if the content pushes the body beyond 100vh it will continue growing. However if you have content that takes less than 100vh it will still take 100vh in space.

.

I hope you find this helpful 😄 Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

1
Hassia Issah 50,670

@Hassiai

Posted

Every html must have <h1> to make it accessible. Always begin the heading of the html with <h1> tag wrap the sub-heading of <h1> in <h2> tag, wrap the sub-heading of <h2> in <h3> this continues until <h6>, never skip a level of a heading.

For a responsive image that will change the images at different screen sizes use the picture tag. For more click here

For responsive content, replace the width in .container with max-width, using the max-width you only need one media query for the mobile design with a reduce max-width value. max-width:25rem. This will reduce the as the screen size reduces and increase as the screen size increases until it reach 25rem.

There is no need to give .container-info and img-container a height value rather give .container-info a padding value for all the sides, this will prevent the content from overflowing on smaller screens.

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

Marked as helpful

1

Peter Wahu 190

@Pe-te-r

Posted

@Hassiai Thankyou for your advice. On my next project i will consider your advice regarding use of max-width instead of a fixed width

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