I\'m having a heck of a time with this particular CSS selector which does not want to work when I add :not(:empty) to it. It seems to work fine with any combina
:not(:empty)
Another pure CSS solution
.form{ position:relative; display:inline-block; } .form input{ margin-top:10px; } .form label{ position:absolute; left:0; top:0; opacity:0; transition:all 1s ease; } input:not(:placeholder-shown) + label{ top:-10px; opacity:1; }
Firstname Lastname