Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 month ago

Responsive product preview card using Flexbox and CSS variables

Prashant Raj•70
@prashantrajch
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'm most proud of how clean and responsive the layout turned out across different screen sizes using only HTML and CSS. I structured the markup semantically and used modern CSS techniques like Flexbox and custom properties, which helped keep the code organized and scalable.

If I were to do this again, I would focus more on accessibility — including keyboard navigation and ARIA roles — and explore converting the component into a reusable React component to practice component-based development.

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

One challenge I faced was ensuring the layout looked good on both desktop and mobile screens without breaking the design. I solved this by taking a mobile-first approach and using media queries to adjust the layout for larger screens. Another tricky part was handling the background image responsively — I used CSS background properties and different image files for mobile and desktop views to keep the design sharp and fast-loading.

What specific areas of your project would you like help with?

I’d appreciate feedback on the accessibility of my component — especially regarding semantic HTML, alt text usage, and interactive elements like the button. I'm also interested in suggestions for optimizing my CSS structure or making it more reusable and scalable. If there are any best practices I missed for responsive design or performance, I'd love to hear them as well.

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 Prashant Raj'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