FAQ-accordion _html_css_only

Solution retrospective
I tried with JS but, run into problems when doing two functions for each clickable element
Please log in to post a comment
Log in with GitHubCommunity feedback
- @MelvinAguilar
Hello, first of all, congratulations on completing this challenge!
I've reviewed your code and noticed a few things I'd like to highlight:
- The
<a>
tag is meant for links to direct users to another page or section of your website. However, you've used too many, and you shouldn't because clicking should performs an action. In such cases, it's better to use the <button> tag.
- Enclose both the icon and the text in a SINGLE
<button>
tag to avoid duplicating the open/close effect.
- A simpler way to approach this challenge is to use
<details>
and<summary>
, which allow you to achieve this without the need for JavaScript.
- Regarding the JavaScript code, I would suggest making the other element visible or invisible without modifying its height.
I hope you find it useful! 😄
Happy coding!
Marked as helpful - The
- P@danielmrz-dev
Hello @MisterCcobD!
Your project looks really good!
I just have one suggestion:
- You don't need a separate container to create that background pattern. You can use both
background-color
andbackground-image
together on the body. They will not cancel each other.
I hope it helps!
Other than that, great job!
Marked as helpful - You don't need a separate container to create that background pattern. You can use both
- @Serdarq1
Hi, what kind of problems you ran into? If you tell me I can do my best to help you out.
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