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 page with flex

P
tomdu3 20

@tomdu3

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


I couldn't divide evenly the boxes and don't know what is the reason that image takes more space on bigger screens.

Community feedback

Fer 3,970

@fernandolapaz

Posted

Hi 👋, regarding your question:

  • The easiest way is to use Grid for the card and then divide it into two equal columns.
.card-outer {
display: grid;
grid-template-columns: 1fr 1fr;
}
  • And note that there is a different image for each version. To make that change, the <picture> element is ideal:
<picture>
<source media="(min-width: x)" srcset="images/image-product-desktop.jpg">
<img src="images/image-product-mobile.jpg" alt="description">
</picture>

Please let me know if it works 🙂

Regards,

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