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-accodion-card-HTML-CSS-JS

@Amandeep715

Desktop design screenshot for the FAQ accordion card coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Finally completed the faq accordion project. This was my first time using JavaScript on a project and positioning the images was also very hard.

Community feedback

@pikapikamart

Posted

Hey, awesome work on this one. Layout in desktop is smaller than the design but it's fine for now I guess, it is responsive and the mobile state looks great.

Some suggestions would be:

  • Avoid using vh unit on height property on a large container like the main on this one , as this limits the element's height based on the remaining screen's height. Instead use min-height: 100vh, this takes full height but lets the element expand if needed.
  • Also, don't use width: 100vw as this create an extra vertical scroll since this doesn't account the vertical scrollbar's size.
  • All the images used in here are just decorative since they are only vector. Decorative image must be hidden at all times by using alt="" and extra aria-hidden="true" attribute on the img tag.
  • For every button it would be great to have a default attribute of aria-expanded="false" and when the button is toggled, this will be set to true and vice-versa. You will be needing to use .setAttribute. This way, users will know that is has expanded/shown something.

Aside from those, great work again on this one.

Marked as helpful

0

@Amandeep715

Posted

@pikamart First of all thanks a lot for your feedback. It was very informative, actually this was my first time learning about ARIA and now look more information about it on MDN.

1

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