Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Responsive card using Flexbox and Media Queries

Rizwan Khan•130
@mdrizwanfk
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I feel I have extensively and conveniently used Flexbox across this project.

Q1. Can any flexbox alternatives be more efficient in any of the scenarios? (Below is the list of places I used flexbox:

  1. Alignment of Discounted and MRP prices.
  2. Within the Call-to-action Button for the Icon and Text's Alignment.
  3. In Desktop Design, Centering the Card Component vertically and horizontally.
  4. In Desktop Design, Flexing Image and Description within card to Row direction.
  5. In Desktop Design, Spacing a Column Flex of Card Description elements.)

Q2. Suggestions/Improvements to structure responsive bits in the code. (style.css)

Q3. I have not used img HTML elements for the Card image throughout this project, I used background-image CSS Rule instead, Will this impact SEO and Search results? And is my implementation considered as best practice in the industry?

Q4. Is there a more elegant way to Round corners of our divs, in this case. I had to repeat border-radius at 2 places, one for image div and the other for the card. Can this be improved?

Thanks for reviewing, in advance. Stay safe & take care :)

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 Rizwan Khan'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
  • Use cases

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