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

Product preview card for desktop and mobile

MURRAY122•280
@MURRAY122
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 did have an img tag within the HTML page, but I removed it due to not being able to change the src of the image as the media screen changed from mobile to desktop. I do wonder however if it would be possible to have changed this without the need for JavaScript and strictly CSS.

I also used CSS variables but had to resort to manually inputting the hsl for the button hover. I did attempt to use hsla with the variable within in it and then just change the alpha but didn't have the desired effect. I wondered if I missed something or if there is a better approach to darkening the background without effecting the text color of the button.

Edit - Updated CSS Layout

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 MURRAY122'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