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

Responsiveness and Proper Spacing

CocoShesh 160

@CocoShesh

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


  1. I'd appreciate any feedback on my code, especially regarding best practices and coding conventions. Are there any areas where you think I could have written the code more efficiently or used better practices?
  2. How well does the product preview card component respond on different devices and screen sizes? Are there any issues or improvements you'd suggest for better responsiveness?

Community feedback

hitmorecode 6,230

@hitmorecode

Posted

Congratulations well done. The desktop version it is ok, you just need to fix the button. Remove the border and add a hover effect.

Because the page needs two different pictures that are loaded in different occasions. You can use the picture element to do this.

There is also some distortion on the image when going to mobile version and the width of the image doesn't match the width of the card.

<div class="img-side">
<picture>
<source media="(min-width: 750px)" srcset="images/image-product-desktop.jpg">
<source media="(min-width: 375px)" srcset="images/image-product-mobile.jpg">
<img src="images/image-product-desktop.jpg" alt="Product Image">
</picture>
</div>
@media screen and (max-width: 750px) {
.product-card {
flex-direction: column;
}
   
.img-side img {
/* to fix issues with the image on mobile */
width: 317px; /* change to this */
height: 100%; /* change to this */
border-radius: 10px 10px 0px 0px;
}

Marked as helpful

0

CocoShesh 160

@CocoShesh

Posted

@hitmorecode Thank you for reaching out and sharing your comment. I value your feedback and appreciate your input.

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