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

Product card using flexbox & SCSS

irene 120

@irene-panis

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


What are you most proud of, and what would you do differently next time?

learned something valuable as i didn't know about the element, actually had the same problem in a personal project of mine so will be going back and retooling it to use that

What challenges did you encounter, and how did you overcome them?

how to change the picture on desktop vs mobile, found some guidance in the frontend mentor discord

What specific areas of your project would you like help with?

felt kinda iffy on setting the max-width of the card? also what do i do when the window gets REALLY small (like when im using responsive dimensions in devtools and i just keep making the preview thinner and thinner) because that just shrinks the card and it doesnt really stop shrinking.

Community feedback

P

@danielzeljko

Posted

Nice work, Irene!~

      <picture>
        <source srcset="images/image-product-mobile.jpg" media="(max-width: 767px)">
        <source srcset="images/image-product-desktop.jpg" media="(min-width: 768px)">
        <img src="images/image-product-desktop.jpg" alt="Gabrielle Essence Eau De Parfum perfume">
      </picture>

We can simplify this by setting the mobile version of the image as the default and only using one source for the desktop image:

<picture>
  <source srcset="images/image-product-desktop.jpg" media="(min-width: 768px)">
  <img src="images/image-product-mobile.jpg" alt="Gabrielle Essence Eau De Parfum perfume">
</picture>

How'd you get the value of 768px? The readme mentioned desktop resolution was somewhere in the 1100px range.

I honestly don't think you really need to worry about such small window screens. No one will use a phone that has like 100px width, so the shrinkage really isn't a problem. I didn't see this problem on your live version of the site even using the responsive design mode.

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