Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 4 years ago

FAQ Accordion Card | HTML CSS Sass JS

accessibility, lighthouse, sass/scss, bem
Vanza Setia•27,715
@vanzasetia
A solution to the FAQ accordion card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hello Everyone! 👋

I finally finished the first JavaScript challenge. 🎉

After learning JavaScript for about one month. Here's the result! 😎

Now for the questions:

  • Does this website looks good on your device?
  • For the FAQ, I uppercased the letter on the HTML file instead of doing it on CSS. I'm afraid that the screen reader will pronounce FAQ when it should spell F-A-Q (letter by letter). So, is the screen reader smart enough to spell the faq letter by letter?
  • Please try to navigate this website using your keyboard. If you don't know how to navigate using a keyboard, see the keyboard support section. Do all the keys work based on the functionality?
  • For those of you who have finished this challenge, which text uses a very dark grayish blue color (hsl(237, 12%, 33%))?

Any questions on the technique that I'm using are very welcome!

Also if you want me to give my feedback on your solution to this challenge, feel free to give me the link in the community feedback! I will be glad to help you too!

Hint: Try to disable JavaScript to get the pop-up box that will give you the link to the non-javascript version (using details and summary tag) or just click this.

Thanks!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Dave•5,295
    @dwhenson
    Posted almost 4 years ago

    Hey @vanzasetia lovely job here! 🙌 Looks great and functions really nicely with the keyboard.

    Did you consider using the details-summary tag here? If so I'd be keen to know why you opted not to use it. I just ask as it might have made your mark-up easier and require less aria attributes.

    ** Hang on I think I missed the link to your other solution without JS - did you just add this?

    My only small suggestion would be to make the focus styles a bit easier to see, perhaps a bit thicker –using outline-offset with a small value can also help making it look nice. But this is really a small point!

    Lovely job!! 👍

    Cheers 👋

    Dave

    PS If you were concerned about the "FAQ" you could perhaps try aria-label, I'd need to check but I think this will stop readers accessing the content and read the content of the label, so you could try aria-label="frequently asked questions" - I'd need to test this to be sure though.

    Marked as helpful
  • Eric Aguayo•1,095
    @EAguayodev
    Posted over 3 years ago

    Your finished challenge looks good! Got a question, how were you able to make your panel transitions smooth when a user clicks on them to open them? I did this challenge a while ago and mine jumps up and down weirdly when I click on mine. Heres my live link https://frontendmentor-faq-accordian-page-ax6ky8byj-ericaguayo90.vercel.app/. Overall, very impressive!

    Marked as helpful
  • Yuko Horita•645
    @Sloth247
    Posted almost 4 years ago

    It looks awesome! I like your banner on Github too. I also tried this challenge a while ago and could not close the panels by only HTML and CSS (without JS). I appreciate if you give me a feedback on mine too!

    Marked as helpful
  • Pop Andrei•120
    @pccipri
    Posted almost 4 years ago

    Hey, just took a look over your solution, and I gotta say it looks awesome(although keep in mind that I am a beginner as well).So if u can give me any tips on well anything :) but especially responsiveness and if u have any tips on image positioning I would appreciate that as well. Anyway as for your question about the text color I think it's used on well, pretty much all the text. My solution - this is the link to my solution

    Marked as helpful
  • Mathias de la Fuente•40
    @mathiconh
    Posted almost 4 years ago

    Hey, nice challenge, looks awesome, just a comment. The shadow svg, is positioned above the woman svg. that is resolved with z-index: 2 in shadow, z-index: 1 in woman. Cheers.

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

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub