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 preview product card component

@Akinyemi4

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


Hey there, I just concluded the preview product card component challenge, kindly check it out. Your feedbacks are highly welcomed. Also, if you have a solution on how to fix the flexbox gap issue on safari for old iOS devices kindly drop it.

Thanks.

Community feedback

T
Grace 29,310

@grace-snow

Posted

Hi

I’m afraid this does not fit on my mobile screen, it’s spilling off to the sides

The html isn’t bad but you are causing yourself all sorts of problems with the way you are approaching responsiveness. I can’t stress this enough - Do not change root html font size like this. All this does is introduce accessibility failures and create really hard to maintain code. There is no reason 1rem needs to equate to 10px and no reason it would need to equate to anything else either. Just don’t do it.

To make this responsive (the mobile version should be the base style of following best practices) the only things that need to change in a media query are

  • max width on the component
  • flex direction
  • height on image

As this is a meaningful image it makes much better semantic sense to have it in the html in a picture element. The browser will then choose the correct image to serve for mobile and desktop.

And there is no need for duplicate font link declarations in the head or multiple css files.

Keep it simple

Marked as helpful

0

@Akinyemi4

Posted

@grace-snow thank you very much.I’ll take note of that in subsequent challenges.Thank you for the nice and beneficial feedback.

0
T
Grace 29,310

@grace-snow

Posted

@Akinyemi4 definitely take the time to refractor this one before moving on

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