Design comparison
Solution retrospective
This is my second attempt at this challenge. I wanted to try using Bootstrap for the accordion - is it okay to use Bootstrap just for one component? It did take me quite a while to reset/overwrite the styles in order to match the design.
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, awesome work on this one. Just to say that this is a really great solution^^. Both desktop and mobile view looks really great and it is responsive.
You don't. Bootstrap is too much for a single component, better to just use css/scss on this one and I don't really use bootstrap so I kind of just respond with a no :>
Some other little suggestions would be:
- Those aren't really articles at all and just a simple accordion hence using heading tags for those aren't really suited. Using
ul
on this would be fine so that users will know how many accordion items in this FAQ section. - You don't need to label those container via
aria-labelledby
since those only works with sectioning elements likesection
and others. Also it would be better to just itdiv
.
Aside from those, great job again on this one.
Marked as helpful1@BenConfigPosted about 3 years ago@pikamart Hey, thanks for your comments. They are always so helpful and insightful.
I would prefer to use plain CSS, but Bootstrap is still often mentioned on job specifications, so I feel I ought to practise using it occasionally.
I used an
article
tag for each accordion item, but I can now see this is wrong as they aren't 'independent items of content'. As you say, aul
would make sense here and each accordion item can be ali
.The
h2
s andaria-labelledby
attributes (in fact all the attributes used in the accordion) belong to Bootstrap's accordion which I have copied and pasted into my project.What did you mean by "Also it would be better to just it
div
"? Do you mean replace theh2
s withdiv
s? I was thinking of removing those containers entirely.1@pikapikamartPosted about 3 years ago@BenConfig Hey, great that you find it useful^^
Sorry for the confusion :>>, what I meant was, since I implied that
aria-labelledby
only works sectioning elements, you don't need to use that attribute on thediv
which you are using right now and just use simply adiv
without the attribute.0 - Those aren't really articles at all and just a simple accordion hence using heading tags for those aren't really suited. Using
Please log in to post a comment
Log in with GitHubJoin 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