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

@Eman-Abdallah

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Lucas ๐Ÿ‘พโ€ข 104,420

@correlucas

Posted

๐Ÿ‘พHello Eman, congratulations for your solution!

Your card component is just perfect and also responsive, to manage better the images you can use <picture> instead of <img> + css to switch images with a media query. Using <picture> you can wrap both desktop and mobile images together and set when they should swap between devices all inside the html code.

Note that you text isn't fitting the container after 250px, to solve that you can create a media query to make the price text separate in two different rows:

@media (max-width: 200px) {
.price {
    display: flex;
    flex-direction: column;
}}

Hope it helps and happy coding!

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