Design comparison
Solution retrospective
it was a nightmare... to calibrate the images on the left. It took me way more time it should have been...
Position absolute of these image, i dont get how they can be a solution since anything positioned as absolute leave the main page... yet i used them because it kinda worked (only solution i managed to find) only because the difference of pixel between different mobile screen or desktop screen isnt that big.
Community feedback
- @Kamasah-DicksonPosted over 2 years ago
Your solution looks great but I suggest these.
-
To use position absolute you need a position relative on its parent. It behaves like a sticker and a wall. The sticker is positioned absolute and the wall is positioned relative.
-
you can a transition on your drop down too.
Besides good job thereπ Happy codingππ»
Marked as helpful1@EtnoPolinoPosted over 2 years ago@Kamasah-Dickson
-
i've done this suggestion but i cant really see what has change in my solution.
-
Initially i tried a transition on the drop but it cant work since i cant put a transition on a
display
style. i tried something like.hide { display: none; transition : display 0.5s }
since hide is the class allowing me the drop down. I dont know how i could put this transition.
0@Kamasah-DicksonPosted over 2 years ago@EtnoPolino Transitions don't work on Display:none you can rather use visibility: hidden
Marked as helpful1@EtnoPolinoPosted over 2 years ago@Kamasah-Dickson
after 2h of try harding.. i finally did it with
.answer { max-height: 0; overflow: hidden; transition: all 0.3s ease-in; }
and
` const panel = this.nextElementSibling;
if (panel.style.maxHeight) { panel.style.maxHeight = null; } else { panel.style.maxHeight = panel.scrollHeight + "px"; }
}`
answer is my class holding the faq answer.
what find very weird is that after i managed to this, i found a video about transition FAQ that had the exact same html structure than mine, yet when i tried to reproduce it didnt work. Annoying.
1@Kamasah-DicksonPosted over 2 years ago@EtnoPolino Am so Glad you successfully made 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