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

yzhuuuu 170

@yzhuuuu

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


how to adjust image size is kinda difficult

Community feedback

Riki Wendri 1,380

@F4YY

Posted

Hi @yzhuuuu,

Congratulation for successfully completing the challenge...

In your provided code, it seems that you're using min-width for the mobile image and max-width for the desktop image. To clarify:

The min-width media query is used to specify styles for screen widths equal to or greater than the specified value. The max-width media query is used to specify styles for screen widths less than or equal to the specified value.

If you're aiming to show the mobile image for smaller screens and the desktop image for larger screens, you might want to adjust your media queries accordingly. For instance:

-> Show mobile image for screens up to 600px wide:
@media (max-width: 600px) {
  .img-container img {
    display: block;
    max-width: 100%;
    height: auto;
  }
}
-> to show desktop image for screens 601px and wider:
@media (min-width: 601px) {
  .img-container img {
    display: block;
    max-width: 100%;
    height: auto;
  }
}

Hope that could be helpful. Keep happy coding...

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