<body>
<div style="text-align:center">
<form method = "post" action = "">
账号:<input type = "text" name = "text"><br/>
密码: <input type = "password" name = "password"><br/>
<input type = "submit" value = "提交" name = "B1">
<input type = "reset" value = "重写" name = "B2">
</form>
</div>
</body>
</html>
采用css给iput指定宽度可以将其规范到指定的长度。
具体代码如下:
<formaction="save.jsp" method="post">
<table>
<tr>
<td align="right">用户名 :</td><td><input type="text" name="username"style="width:300px"/></td><br />
</tr>
<tr>
<td align="right">密码 : </td><td><inputtype="password" name="pwd" style="width:300px"/></td><br />
</tr>
<tr>
<td align="right"><inputtype="submit" value="登陆"style="width:60pxheight:30pxfont-size:16px"></td><td>没有用户名?<ahref="/register.jsp">[注册]</a>一个吧</td>
</tr>
</table>
</form>
<html><!--样式--><style type="text/css">#c { position: relative}
#a { position: absoluteleft: 10top: 10font-size: 12pxfont-family: 宋体}
#b { position: absoluteleft: 10top: 10font-size: 12pxfont-family: 宋体-moz-opacity:0opacity: 0filter: alpha(opacity=0)}
</style><body><div id="c">
<input id="a" />
<input id="b" onkeyup="document.getElementById('a').value=this.value.replace(/./g,'*')" />
</div></body></html>....你也可以把 *号改成其他字符....自己试试看吧...
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)