1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > CSS样式的补充:​如何设置文本框内的默认文字?​

CSS样式的补充:​如何设置文本框内的默认文字?​

时间:2018-11-09 05:05:15

相关推荐

CSS样式的补充:​如何设置文本框内的默认文字?​

如何设置文本框内的默认文字?

效果如图:

下面是源代码。

<!DOCTYPE html><html><head><meta charset="utf-8"><title>placeholder属性</title></head><body><input type="text" placeholder="点击搜索" /></body></html>

单行文本框

语法:

<input type="text" />

placeholder属性

设置文本框内默认文字

<!DOCTYPE html><html><head><meta charset="utf-8"><title>placeholder属性</title></head><body><input type="text" placeholder="在这里设置默认文字" /></body></html>

效果图:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。