@mihalymarcell86
Posted
Hi @samanthascarcella,
first of all, congrats on your solution. Very nice! :)
The reason for your card seemingly moving to the top is that you set align-items: center
on the body
. Every time you open a dropdown, the overall height of your card component changes, and flexbox repositions it accordingly. It stretches in both directions.
The way I solved this issue was that I set align-items: flex-start
and added padding-top
instead to position the card. This way, when it resizes, it will only extend downwards.
Hope, that helps!
Marked as helpful
@samanthascarcella
Posted
@mihalymarcell86 Thank you so much! I added a margin to my card after your comment and it resolved the problem. Thank you so much for the tip!
@mihalymarcell86
Posted
@samanthascarcella Happy, I could help! :)