I want to display the label of an input inside its input, so that when I click the input, the label will animate and go above the input and change the styles of the input\'s bor
Like @daniel-j-abraham i use the input:not(:placeholder-shown) ~ label method. You just need to set a placeholder=" " (with a space) to your inputs (see this pen for live example) it works just like the required method but it's way more convenient since it works also with non required fields.
i don't understand why this method isn't more used / upvoted ^^
HTML :