FAQ accordion card - CSS Grid and Flexbox
Design comparison
Solution retrospective
- Any tips on how to guess the box shadow parameters from the design preview images?
- How could add expanding and collapsing animations to the accordion items?
- How do I set the background gradient to take up exactly 100% of the viewport's height?
Community feedback
- @DavidMorgadePosted about 2 years ago
Hello Lucca, congrats on finishing the challenge! good job!
I will try to answer your questions as good as I can:
-
You can use a CSS box-shadow-generator combined with a chrome extension called pixel-perfect to check wich box shadow fits better, or just go the old way and try until you get the desired effect!
-
You will probably have to manipulate the
height
of the element that dropsdown with a JavascriptaddEventListener
and then add an animate effect from height 0 to 100!, it sounds simple but is a bit trickier and hard to get used to it. -
Set your body
min-height: 100vh
and the background will take the whole screen, if you want it to get exactly the screen on your project, you will have to remove the margins from yourcard
and use flex on the body like this:
body { min-height: 100vh display: flex; justify-content: center; align-items: center; }
Hope my feedback and aswers helped you!, if you have any questions, don't hesitate to ask!
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