Responsive Accordion with HTML/CSS/JS

Solution retrospective
I spent a little longer on this one because unhiding elements on the page when opening the accordion causes content above to move up. This was problematic in mobile-view since the image on top of the card kept moving up, so I had to add the height of the unhidden accordion answer to the card's overall height.
If anyone has a more elegant solution for how to solve this, feel free to mention it below. Thanks for any feedback!
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Priya Aggarwal's solution.
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