DEV Community

Cover image for Input Fields with Floating Label (CSS Only)
Altug Gurkaynak
Altug Gurkaynak

Posted on • Edited on

Input Fields with Floating Label (CSS Only)

I tried to create a better input experience.

  • Before clicking, the placeholders are set.
  • On click, the placeholder turns to a floating label.
  • If the area is filled, border disappears. I used :not(:placeholder-shown) for this.

Nice for a11y and UX (hopefully)

Please share your thoughts: altug.design

Top comments (0)