Design comparison
SolutionDesign
Solution retrospective
Hello! This is my solution for FAQ accordion. I have achieved 100% in Lighthouse score for performance, best practices, accessibility and SEO. 📊 Any tips are welcomed! Thank you. 😊✌️
Community feedback
- @yozidstPosted 11 months ago
~ Hi, there
Great job on the challenge! A quick tip on the layout,
Instead of using Top, Left & transform like such,
.main__content-box { display: flex; flex-direction: column; background-color: var(--clr-white); position: absolute; width: 25rem; top: 40%; left: 50%; transform: translate(-50%, -50%); padding-bottom: 1.0063rem; border-radius: 1rem; box-shadow: 0rem 2rem 3.5rem 0rem rgba(80, 0, 118, 0.1); }
I would recommend something along the lines of:
.main__content { position: relative; display: flex; align-items: center; flex-direction: column; padding: 34px; // depending on preference; bottom padding* mainly margin-top: 134px // depending on preference; this was my setup }
This would allow for the content to stay in place instead of the accordion shifting up and getting cut off. I just completed mine. Although, I used java script, the layout maybe be helpful.
Marked as helpful1
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