Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 4 years ago

Stats preview card using Flex/Grid/Media queries

Adrian H•420
@AdrianX19
A solution to the Stats preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


For some reason I struggled with this one a bit, wanted to achieve the result as close as on the provided designs and ended up with some weird fixed values here and there so it might be improved but my my two biggest issues were

  1. Changing the black and white picture to be violet - I tried with both 'filter' and 'mix-blend-mode' properties but neither provided me with the result I wanted so I ended up with creating pseudo element on top of the image and gave it some opacity but still the result is not same as on the design - any ideas how to achieve this effect?
  2. I used img element and struggled to change the src based on the width - I tried with srcset attribute but it didn't work for some reason so I ended up using content: url() in media queries. I probably should have used some div with background-image instead of a img but anyway - any other suggestions how to switch between different images based on the screen width when using img tag?
  3. I've noticed that my solution's screenshot looks super weird :O any idea why?

Any kind of feedback is super appreciated!

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 Adrian H'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