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

Landing page responding to 4 different screen sizes

Alex Kim•1,325
@alex-kim-dev
A solution to the Huddle landing page with alternating feature blocks challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


There's a couple of slightly different buttons in this challenge. What's the best approach for organizing these small differences in css?

My solution is to make a class button for the white one, and a modifier button-accent for the pink one. (i use bem with camelCase & single dash/hiphen) Both include different styling for various screen sizes. But the pink button is slightly different in some cases: a bit wider or has smaller text while keeping the same height. I reflected these changes in additional contextual classes: hero_button & cta_button.

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 Alex Kim'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
Frontend Mentor logo

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