How to create a label inside an <input> element?

后端 未结 13 576
悲哀的现实
悲哀的现实 2021-01-29 22:54

I would like to insert a descriptive text inside an input element that disappers when the user click on it.

I know it is a very common trick, but I do not know how to do

13条回答
  •  情歌与酒
    2021-01-29 23:38

    I think its good to keep the Label and not to use placeholder as mentioned above. Its good for UX as explain here: https://www.smashingmagazine.com/2018/03/ux-contact-forms-essentials-conversions/

    Here example with Label inside Input fields: codepen.io/jdax/pen/mEBJNa

提交回复
热议问题