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

FAQ accordion using Tailwind CSS

@rajeshwaran-1

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


What are you most proud of, and what would you do differently next time?

I started from scratch then i worked on the way up, It took me sometime to figure out the alignment and margins but i finished it. i didn't add transition gotta learn more, if you know feel free to say how can i add custom transition in tailwind css

What challenges did you encounter, and how did you overcome them?

Setting background images was a chore but i find those breakpoints and set things on them.

What specific areas of your project would you like help with?

transition

when i touch my button it reveals the answer but i want transition: 300ms ease i don't know how to do that plus i'm using js for the first time

Community feedback

Alex 3,130

@Alex-Archer-I

Posted

Hi!

Alas, transition doesn't work with changing display properties and with height if it's set to auto. So, we have to find various strange ways to animate accordions.

I solved this by changing height via JS from 0 to scrollHeight - it's a special readonly property which return a height of the element's content. That way transition works.

Marked as helpful

0

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