FAQ Accordion Card Component (HTML, CSS and JavaScript)
Design comparison
Solution retrospective
Hey guys! Here is the solution for my second challenge. I coded this one using pure CSS and a bit of JavaScript. All feedback is much appreciated, but espacially on JavaScript since I just started to learn some JavaScript fundamentals and event handlers. Thx!
Community feedback
- @ericsalviPosted over 3 years ago
Hey, congrats on finishing the challenge. The JS in this one looks pretty solid. The beautiful thing about JS is that it can be built in many different ways. So the way you did it would be different than the way I would do it. Both are valid. The results are the same.
I would try to challenge you to see if you could redo this one with no JS. The accordions could be built out using radio selects and only CSS to show and hide the info.
Lastly, your FAQ section looks off on mobile. Check out,
.faq-wrapper { overflow: scroll; }
Is it needed? It is giving me some weird padding issue on mobile.
1@kamilcodesPosted over 3 years ago@ericsalvi Thank you for the feedback. I deleted the overflow: scroll. I also double checked the FAQ section on mobile on Safari, Chrome and Firefox and it seems to look and work ok. Can you tell me where you see the padding issue?
1@ericsalviPosted over 3 years ago@kamilcodes It is much better now. The overflow was causing some weird misalignment/padding. Since you fixed that the padding issue went away.
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