html input标签显示文字提示

只需要在input标签里使用placeholder属性即可。
即:

<input type="text" name="username" placeholder="用户名"/>
<input type="password" name="password" placeholder="密码"/>

效果:
a

发布了41 篇原创文章 · 获赞 28 · 访问量 9075

猜你喜欢

转载自blog.csdn.net/wang15877/article/details/102468056