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

Pricing Component with Toggle using HTML, JS, SCSS

Cats-n-coffee•670
@Cats-n-coffee
A solution to the Pricing component with toggle challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hi everyone! I completed this challenge using Scss to nest some elements and keep the stylesheet cleaner. The toggle switch changes the text dynamically using JS, what would be the preferred way to do this? I struggled with the mobile responsiveness to maintain the card width, so I ended up using media queries to change the width as the screen grows. I also had to set a negative margin at the very top because as the screen grows there is a strange unoccupied space at the top (at least on my computer), any idea what I did wrong ? Finally, this was my first time trying to add rules for browser support, I used a website to add vendor prefixes, but there is still a different result on Safari. Any feedback would be greatly appreciated, thank you!

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 Cats-n-coffee'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