Responsive FAQ accordion card, using HTML, CSS & JS
Design comparison
Solution retrospective
Hello Everybody! π
This challenge was trickier than I thought:
- To avoid the overflow:hidden from the white card to apply on the box image on desktop mode: I used an empty div to position the box. The empty div has the same dimensions as the white card, so the box will move accordingly to the white card's resizing.
- I added a transition so the answer can unwind smoothly when clicking on the question. I had to include the height + the padding-bottom in the transition.
- I tried making it pixel perfect, but it means the card is not centered
I'm not sure I proceeded correctly for these points. Any feedback is welcome! π Thank you in advance
Community feedback
- @ApplePieGiraffePosted over 3 years ago
Greetings, Hoophelie! π
Nice to see you complete another challenge! π Good job on this one! π Your solution looks great and the accordion works well! π
Two minor suggestions I have are making sure there is always a little bit of space between the accordion card and the bottom of the page (even when multiple FAQs are opened) and adding
cursor: pointer
to the FAQs so that users can even more easily tell that they are clickable. πKeep coding (and happy coding, too)! π
2 - @samuelpalaciosdevPosted over 3 years ago
Hi, Hoophelieπ
Great job on this challenge. Your solution looks good and scales pretty wellπ
I hope you have a nice day, keep coding!π
1 - @AgataLiberskaPosted over 3 years ago
Hi @HOOPhelie, well done on this challenge. Don't worry about making it pixel perfect, it really doesn't need to be!
Nice work with the transitions, I think it would be great if you added one to the toggle arrows as well :)
There is one problem though (and it's the same mistake I made with this challenge) - at the moment the accordions are not accessible as there is no way to get to them using the keyboard. To make them accessible, you could use buttons as clickable elements :)
Hope this helps :)
1
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