Accordion FAQ fully done by css using element (thanks Grace)
Design comparison
Solution retrospective
Is there a way to make it more beautiful?
I've done the accordion using only css and <details> element. My main issue is that when I click on a new question the previous answers don't collapse (which is quite annoying for me). I've tried using only css without any js for the bonus points. On StackOverflow people answered that they believe that it could be done only by js.
Essential, for the above-mentioned reason I needed to make a height bigger than usual, which doesn't look nicely when all the answers are collapsed.
Community feedback
- @DmytroTarasiukPosted over 3 years ago
Hey. You definitely should use js to make your answers collapse. Alternatively , you can use ':hover' method then it doesn't require a click and answers not gonna collapse. Secondly, website is not responsive on the wide 400px - 800px. Try to add more queries or edit the existing one. Happy codding;)
Best regards.
0
Please log in to post a comment
Log in with GitHubJoin 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