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

Mobile first site using HTML, CSS and JavaScript

Karin 20

@KariinDeLeeuw

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


Anyone tips?

Community feedback

Arturo Simon 1,785

@artimys

Posted

Nice job Karin on completing your first challenge. 👍 I have a few thoughts that I hope can help.

User Interface suggestions:

  • To avoid the container from getting too tall in height I would look at changing the behavior of the toggling answers. Only allow one to be viewable. A common technique I see is using radio buttons
  • Add some left/right spacing when your design first switches to desktop.
  • Add a cursor: pointer to your question/arrow hover styles

Code tips:

  • One nifty method to center your entire container is using flexbox on the body
body {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   min-height: 100vh;
}
  • The layering of the 3 desktop images can be tricky. I suggest for the little box to be in it's own div container using absolute positioning. For the other images you can try setting them both as multiple background images more info here

  • Be sure to check out your solution report

Keep it up and happy coding 👍👍

Marked as helpful

1

T
Grace 29,490

@grace-snow

Posted

I'll throw a spanner in the works and disagree with one of @artimys points above (other advice sounds great tho!) . You've made the accordions work exactly as they should and used an accessible pattern. It's an established ui pattern that collapsing sections (accordions) should allow for multiple to be open at once, otherwise it would be vertically stacked tabs and assistive tech would expect tab behaviour.

To fix your html validation issues you can put the button elements inside the faq question paragraphs rather than the other way around. I'd probably make them headings actually - they are headings for the answer content underneath so that would make sense. If you styled these headings in css, you can easily pass those styles down to the button with inherit: all.

I've only looked on mobile, but this looks good to me, well done 👍

Marked as helpful

0
Arturo Simon 1,785

@artimys

Posted

@grace-snow Accordion Debate!! j/k. To clarify my comment in case it's thought that all accordions should only have one panel open at a time. An accordion can go either way of one visible panel at a time or allow multiple open. Either pattern is fair game.

I believe a designer/developer will choose which one best fits their design/UX while always considering assistive technology. Regardless of which pattern used, content is already hidden so aria attributes, tabbing behavior should be utilized appropriately.

In regards to the current challenge. My thoughts viewing it on desktop with any panel open brings an undesirable white space to the box container height. But to your point it works well on mobile also.

Marked as helpful

0
Karin 20

@KariinDeLeeuw

Posted

Thank you guys for all your tips! I will look into it soon.

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