Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

FAQ accordion - HTML, CSS, & Vanilla JavaScript

#accessibility
darryncodes 6,430

@darryncodes

Desktop design screenshot for the FAQ accordion coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

Having completed the original FAQ challenge it felt only right to complete the updated version!

I tried to make this component as accessible as possible by:

  • using semantic html and the most appropriate interactive elements
  • styling the accordion with focus states to improve the experience for those who navigate the accordion using a keyboard
  • utilising aria-expanded, aria-hidden, aria-controls attributes

What specific areas of your project would you like help with?

Any accessibility specific feedback would be very welcome.

Community feedback

Noel Hoppe 330

@noelhoppe

Posted

Hi, some suggestions:

  1. Remove display: grid properties from body, main and footer and use
display: flex;
flex-direction: column;
justify-content: center; 
align-items: center;

and remove margin properties from main to center your FAQ container.

Nice js!

0

Please log in to post a comment

Log in with GitHub
Discord logo

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