html中实现文本框出现提示功能的多种方法_XHTML教程-查字典教程网
html中实现文本框出现提示功能的多种方法
html中实现文本框出现提示功能的多种方法
发布时间:2016-12-27 来源:查字典编辑
摘要:可以用html5中的属性也可以用js做到加css样式.in_search{border:1none;color:#999999;float:...

可以用html5中的属性 < input ="text" placeholder="你想输入的内容" >

也可以用js做到 加css样式

<style type="text/css">

.in_search {

border:1 none;

color:#999999;

float:left;

font-size:14px;

height:18px;

line-height:18px;

margin:3px 2px;

width:253px;

}

</style>

<input name="q" onfocus="if(this.value=='请输入你想要输入的内容'){this.value='';}" onblur="if(this.value==''){this.value='请输入你想要输入的内容';}" type="text" value="请输入你想要输入的内容"/>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新XHTML学习
    热门XHTML学习
    网页设计子分类