on-internet
← Community

Keep placeholder of Input CSS only

Stack Overflow ·

I have an input field with a placeholder. On focus of it, I need a transition of placeholder and it should stay at a different position. I cannot modify the HTML as it's getting generated from a plugin. I have achieved the transition, but the placeholder disappears after it. Need it by CSS-only. Demo .container { margin-top: 80px; } input { width: 500px; font-size: 16px; } input::-webkit-input-placeholder { -webkit-transition: all 0.3s ease, font-size 0.3s ease; transition: all 0.3s ease, font-size 0.3s ease; } input:hover::-webkit-input-placeholder { -webkit-transition: all 0.3s ease, font-si

Comments

Sign in or sign up to comment and upvote.

No comments yet.