I found a codepen example by Chris Coyer and decided to fork it. My goal is to make the label move to the top instead of staying at the bottom, as in his original design.
However, I am facing an issue with getting the cursor to move to the bottom when typing, which results in the text overwriting the label. The CSS code snippet below is supposed to move the label but it's not working as expected:
form.go-bottom { input { padding: 12px 12px 12px 12px; } label { top: 0; bottom: 0; left: 0; width: 100%; } input:focus { padding: 4px 6px 20px 6px; } input:focus + label { top: 100%; margin-top: -36px; } }
I have tried adjusting the padding settings for the input element but haven't been able to change the cursor position properly. If anyone can provide guidance on how to resolve this solely using CSS/SASS without any JavaScript, I would greatly appreciate it.
Additionally, if someone can help me change the transition animation from top to bottom to bottom to top, that would be fantastic!