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 card using flex box and picture tag

#bem#vanilla-extract

@anandubabu-kr

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


It was a cool challenge. I struggled a bit while trying to change the image for mobile. I did it using <picture> tag. Anyway, I would love to know other ways and standards for achieving the same.

Community feedback

James 340

@James-alderson

Posted

Hi Anandu Babu, I have also used picture tag for this, I think this is the best way to change the image, because for mobile and desktop resolution you don't need to change the image again in the CSS code. You can do it just by writing an extra line of code in the HTML code.

Anandu Babu, the project you designed the width of image card and content card elements are not same, you can solve this problem by putting this style (flex: 1 1 50%;) in image and card__content classes.

Happy coding 🚀

Marked as helpful

1

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