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

常用input文本框内容自动垂直居中并默认提示文字单击为空

51自学网 http://www.wanshiok.com
文本框,垂直居中,提示文字三个功能:

1、内容自动垂直居中
2、默认提示文字显示灰色
3、单击后变为空

复制代码
代码如下:

<input type="text" name="wd1" id="qy_1" maxlength="100" style="color:gray;width:199px;height:30px;line-height:30px;" autocomplete="off" value="请输入企业名称" style="color:gray;" onfocus="javascript:if(this.value == '请输入企业名称') this.value = ''; this.style.color='gray';" onblur="if(this.value == '') {this.value = '请输入企业名称'; this.style.color = 'gray';}">

文本框,垂直居中,提示文字  
上一篇:frameset(划分框窗)常用属性整理  下一篇:input文本框和img验证码对齐问题(img总比input高出一个头)