Design comparison
Solution retrospective
Hey guys. Do you have any ideas how to fix changing positions of answer when collapsing them?
Community feedback
- @gtalinPosted over 1 year ago
Your solution looks very beautiful and elegent.
The culprit for your moving layout for the mobile layout is the flex on the
content
class on yourmain
. You'll have to removeflex
and then the layout doesn't shift around. If you want to center the accordion, usingmargin: auto
oncontent-wrapper
class would do the trick. You will also have to add the linear gradient background tobody
ormain
and then add amargin-top
to prevent the illustration from being truncated when you removeflex
frommain
.For desktop layout, when you use
flex
, oncontent-wrapper
usingalign-items:center
is causing that shift in layout and it is causing your text to move .Hope this solves your problem.
Marked as helpful0@asekabtwPosted over 1 year ago@gtalin Thank you a lot for your answer! I will try to do it)
0
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