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

My solution to FAQ accordion challenge

JhonFXAโ€ข 120

@JhonFXA

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


For some reason, the font isn't loading on the live site. In the console, it shows '404 (Not Found)'. I've encountered this problem in other projects as well when hosting with GitHub Pages. Can someone help ;( ? Any tips are welcome!

Community feedback

P
Chamuโ€ข 12,970

@ChamuMutezva

Posted

Hi JHONFXA

An FAQ like this one is an example of a Disclosure pattern. Here is an excellent explanation of the definition by one of our Mentors at Frontend Mentor , Grace:

A "disclosure" means any user interface (UI) pattern that reveals
 additional content following some kind of user interaction.
 Common examples are tooltips, mobile menu toggles and accordions.

Here is a link for more information Disclosure - ui. Some of the highlights are as follows

  • open disclosures with a button click (not hover or mouseover)
  • use aria-expanded to communicate state to assistive tech
  • use aria-controls to programmatically link buttons with the content they're controlling for the JAWS screen reader

The disclosure has to be interactive, hence you need to use interactive elements such as a button. An img element is not an interactive element and should never have a click event. Alt value should be meaningful if the image is not decorative, a decorative image should have an empty alt value. A message such as expand answer is not beneficial to assistive technology users.

Test your site with a keyboard only , you will find out that the content is not focusable.

Marked as helpful

1

JhonFXAโ€ข 120

@JhonFXA

Posted

@ChamuMutezva Oh, I get it! I'll take care of these issues right away. Thanks!

0
P
Chamuโ€ข 12,970

@ChamuMutezva

Posted

@JhonFXA Another technique to use is the details summary element , it is worth looking at

1
JhonFXAโ€ข 120

@JhonFXA

Posted

@ChamuMutezva Thank you, i'll take a look. I've embedded images within buttons with aria-expanded, aria-controls, and aria-label attributes. I've read that the aria-controls value should be a list of IDs. However, I wanted to avoid assigning a unique ID to each answer, so I dynamically added aria-controls attributes and IDs for each answer using JavaScript.

I'm unsure whether the images inside the buttons need to have alt text, or if the ones I've provided are good enough. I would appreciate it if you could take a look when you have the time to. Thank you once again for your assistance!

0
P
Chamuโ€ข 12,970

@ChamuMutezva

Posted

@JhonFXA

  • the image are just decorative - so an empty alt value is needed.
  • since the buttons have an aria-label , the part of having give the button an accessible name , has been covered. If you navigate with a keyboard , you will notice that the buttons are receiving focus and can be opened and closed

Well done

0
R A H U Lโ€ข 340

@owlbunt

Posted

there is an bug make sure only 1 faq open at a time in your case i can open all question at same time try to improve this.

1

JhonFXAโ€ข 120

@JhonFXA

Posted

@owlbunt Oh, I thought it was supposed to work this way ๐Ÿค”. Thank you.

0
R A H U Lโ€ข 340

@owlbunt

Posted

@JhonFXA may be but in this itll add a scroll bar also take lots of space so anyways nice

0
R A H U Lโ€ข 340

@owlbunt

Posted

@JhonFXA also you have font issue , check font url original fonts are stored inside in fonts/static folder

0
P
Chamuโ€ข 12,970

@ChamuMutezva

Posted

@owlbunt

I don't think , it is a must to have it that way. Here is another example of an Frontend Mentor FAQ

1
R A H U Lโ€ข 340

@owlbunt

Posted

@ChamuMutezva i'm not saying he is wrong bro , in this field you should always keep yourself updated check all modern web they use this design to save space and optimize website , afterall its all about personal choice .

0
P
Chamuโ€ข 12,970

@ChamuMutezva

Posted

@owlbunt

You mentioned it as a bug , that was my concern

0
R A H U Lโ€ข 340

@owlbunt

Posted

@ChamuMutezva kind of actually

0
JhonFXAโ€ข 120

@JhonFXA

Posted

The font is appearing normally now... ๐Ÿคจ

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