Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Pure CSS and JS to build FAQ Accordion Main challenge

P

@flaviocmb

Desktop design screenshot for the FAQ accordion coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I think the first real challenge is responsiveness with two types of background (both delivered in the assets). I used mobile-first concept.

The title questions are buttons. That was one way that I imagine to solve the click expansion (accordion). Also had to learn about pseudo-elements like ::after to set the plus sign icon.

One big problem I found was when the accordion expands in a window with position absolute. How should I deal with scrollbars, whitespace margin and the content below the FAQs window for better UX design? My way to solve was to use overflow-y: auto inside the FAQs window at a max-height of 560px (above that, we should see a scrollbar).

Something that felt so good to code was the little animation on

transition: .25s;

transform: rotate(180deg);

That is all magic to me! :)

Community feedback

Please log in to post a comment

Log in with GitHub
Discord logo

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