Intro component with signup form using CSS and Vanilla JS
Design comparison
Solution retrospective
When the validation texts are visible on the desktop version, the box on the left moves up and down. How can I prevent that?
Community feedback
- @TheqwertypusherPosted over 3 years ago
It moves because the unhidden class on your error message updates [display: none] to [display: block].
[Display: none] removes the element from the flow of the page so it does not take up any space whereas [display: block] will occupy space which causes the intro-try-form to lengthen and ultimately your wrapper to adjust for the newly re-sized content.
You can use positioning to fix this. Make the input [position: relative] and the error message container [position: absolute]
Marked as helpful1@Yemisrach15Posted over 3 years ago@Theqwertypusher Thank you for your feedback. I tried as you suggested and it works🙂
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