Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 5 months ago

Responsive Product Card using CSS Grid and mobile worflow

Chris-Lloyd•110
@chrislloyd876
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am most proud of how I used flexbox to organize my elements with little hassle. I would actually try a more mobile focused approach first as it wasn't really working for me.

What challenges did you encounter, and how did you overcome them?

I had a bit of trouble with changing the image when the screen size changes. I had to set 'display:none' to my images depending on the screen size to run them without crashing the site.

@media (max-width:32rem) {
    .product {
      flex-direction: column;
    }

    .image-desktop {
        display: none;
      }
  
      .image-mobile {
        display: block;
      }
  }
What specific areas of your project would you like help with?

I still have trouble getting everything to fit the right size. They're either still too big or too small compared to the solution.

I'm also still having trouble with reshaping the child elements within their parent element. I still don't understand inheritance when it comes to images.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Chris-Lloyd's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License