AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > 网页制作

html中实现文本框出现提示功能的多种方法

51自学网 http://www.wanshiok.com
html,文本框,提示可以用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" class="in_search" onfocus="if(this.value=='请输入你想要输入的内容'){this.value='';}" onblur="if(this.value==''){this.value='请输入你想要输入的内容';}" type="text" value="请输入你想要输入的内容"/>

html,文本框,提示  
上一篇:Web开发中的基本概念和用到的技术简介  下一篇:meta标签中的使用viewport定义屏幕css