How to keep input placeholder visible when user is typing

烈酒焚心 提交于 2019-11-29 14:45:02

I don't think that you can do it ONLY with standard placeholders, but you can use this example http://css-plus.com/2011/09/make-the-input-placeholder-user-friendly/

I am not sure if keeping placeholder visible on typing is possible or not but you can shift it to right by using this css:

CSS

.example:focus::-webkit-input-placeholder {
    text-align: right;
    opacity: 1;
}

demo

You can use transition to make it align smoothly.

But one solution to your problem is to write the text in placeholder into a span and translate it to right when user starts typing (by using JS)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!