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 Product Preview Page with HTML and CSS

France 100

@LanXhan

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


Hello! Frontend Mentor community! This day 5 solution for product-preview challenge for my daily challenge to code and learn more about front-end development.

Happy to hear feedback and advice!

Community feedback

Account Deleted

Hello Coder🙂

your solution is great 🎉

But you used the wrong method to switch images and there are some better ways are available to handle the image switch problem

You can try <picture> tag to switch image

Picture tag :

<picture>

<source media="(min-width: 597px)"
srcset="./images/image-product-desktop.jpg ">


<source media="(min-width: 0px)" 
srcset=" ./images/image-product-mobile.jpg">

<img src="./images/image-product-mobile.jpg" alt="Product_image">

</picture>

min-height :

You can use min-height instead of height

because height will put your element to a size of 100% of it's container. min-height will put the element to min 100% of the container size.

and it will helpful when you want to make responsive solutions

and you also can take a look of my solution that will definitely going to help you 👀

I hope that will be helpful for you✌️

0

France 100

@LanXhan

Posted

@MrSandipSharma Thank you so much for the advice! Will edit my solution to this!

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