table居中及div背景图片设置
<html>
<head>
<title>服务器配置</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
body{
background-color:#2C80C8;
}
.center{
width:280px;
height:200px;
font-size:14;
position:absolute;
margin:-100px 0px 0px -140px;
top:52%;
left:50%
}
.outCenter{
background: url(p_w_picpath/loginbg.png) center center no-repeat;
width:1000px;
height:600px;
position:absolute;
margin: -300px 0px 0px -500px;
top:40%;
left:50%
}
</style>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
function doSubmit(){
var serverName = $("#serverName").val();
var port = $("#port").val();
var ip = $("#ip").val();
var userName = $("#userName").val();
var password = $("#password").val();
if (serverName == null || serverName == ""){
alert("请填写服务器名");
return;
}
if (port == null || port == ""){
alert("请填写端口");
return;
}
if (ip == null || ip == ""){
alert("请填写IP");
return;
}
//if (userName == null || userName == ""){
//alert("请填写用户名");
//return;
//}
if (password == null || password == ""){
alert("请填写密码 ");
return;
}
$("#form").submit();
}
</script>
</head>
<body>
<form id="form" method="post" action="/aplVncWeb/action/vncInsert">
<div class="outCenter"></div>
<table class="center">
<tr><td>服务器名:</td><td><input type="text" maxlength="30" id="serverName" name="serverName" /></td></tr>
<tr><td>IP:</td><td><input type="text" maxlength="20" id="ip" name="ip" onkeyup="value=value.replace(/[^\d\.]/g,'')"/></td></tr>
<tr><td>端口:</td><td><input type="text" maxlength="4" id="port" name="port" onkeyup="this.value=this.value.replace(/\D/g,'')" /></td></tr>
<tr><td>用户名:</td><td><input type="text" maxlength="20" id="userName" name="userName" /></td></tr>
<tr><td>密码:</td><td><input type="text" maxlength="10" id="password" name="password" /></td></tr>
<tr>
<td align="center" colspan="2"><input type="button" value="提交" />
<input type="reset" value="重置" /></td>
</tr>
</table>
</form>
</body>
</html>