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

CSS is too hard

P
madosy•180
@madosy
A solution to the FAQ accordion card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I tried css only solution for the dropdown first using animation. It worked great--for half the time. The other half the <detail> element just immediately showed the contents without having the smooth animation. why?

In mobile layout, I added padding to the body tag so that my content won't touch the bottom. It didn't and site ignore me lol. I had to add 100% height to html instead--why? why can't I just tell body to occupy 100% and add padding and call it a day?

The background was acting weird too. The smooth gradient would load fine at first load in mobile. As soon as the scrollbars appeared, the gradient would start again? I had to add the background to html. But when I removed the background from body, it would do the same thing--huh?

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