No JS - FAQ Accordion Challenge - flexbox desktop only not responsive
Design comparison
Solution retrospective
-
That image layout was hard!!! Like rock inside an onion. I persevered and finally got it. I ended up going through the SVG file for the geometry of the platform and then learned how to make my own SVG, so I could use them as the backdrop and the wireframe outline above. If there is an easier way, please let me know!
-
I set out specifically to do the accordion with only css because I wanted the practice (Why I'm here at Frontend Mentor). The choice reinforced how limiting the ID selector is, as well as the 'for' attribute in the <label> tag. It led to a ton of code duplication that would make me want to do the project again with JS. I realized I should have gone with radio buttons instead of checkboxes as it would only allow one question open at a time vs. having them all opened.
If I could make the accordion CSS any less duplicated without delving into javascript, please let me know. I tried all the ways I could find to avoid the copy paste increment route.
Thanks!
Community feedback
- @AdrianoEscarabotePosted almost 2 years ago
Hi Wave, how are you? I really liked the result of your project, but I have some tips that I think you will enjoy:
We have to make sure that all the content is contained in a reference region, designated with HTML5 reference elements.
HTML5 reference elements:
<body> <header>This is the header</header> <nav>This is the nav</nav> <main>This is the main</main> <footer>This is the footer</footer> </body>
To prevent the content from stretching too much at higher resolutions, we can use a
max-width
:.main { max-width: 1440px; }
The rest is great!
I hope it helps... 👍
Marked as helpful0
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