Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Accessible FAQ accordion

P
Achara Chisom Solomon•710
@AcharaChisomSolomon
A solution to the FAQ accordion challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


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

Beginning the project with accessibility in mind introduced me to the details and summary tag which made the whole project easier

proud of this html for a single accordion


        
          What is Frontend Mentor, and how will it help me?
          
        
        
          Frontend Mentor offers realistic coding challenges to help developers improve their 
          frontend coding skills with projects in HTML, CSS, and JavaScript. It's suitable for 
          all levels and ideal for portfolio building.
        

and the associated css

details > summary {
    list-style: none;
    cursor: pointer;
    font-size: var(--summary-size);
    font-weight: 600;
    color: var(--heading-color);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
details > summary:hover {
    color: var(--summay-hover-color);
}
.summary-icon {
    width: var(--summary-icon-dimension);
    height: var(--summary-icon-dimension);
    background-image: url(./assets/images/icon-plus.svg);
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}
details[open] > summary .summary-icon {
    background-image: url(./assets/images/icon-minus.svg);
}
details > p {
    margin-top: 1.5rem;
    font-size: var(--details-size);
    color: var(--details-color);
    line-height: var(--details-line-height);
}
What challenges did you encounter, and how did you overcome them?

Nothing much

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

Any feedback is welcome!!!

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Achara Chisom Solomon'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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License