Java代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>键盘控制层的移动</title>
<style type="text/css">
<!--
#Div {
position:absolute;
width:238px;
height:135px;
left:expression((body.clientWidth - this.offsetWidth)/2);
top:expression((body.clientHeight - this.offsetHeight)/2);
z-index:1;
text-align:center;
background:#AFDBFF;
border:#006699 1px solid;
}
#Txt{
font-size:9pt;
position:absolute;
width:200px;
top:expression((Div.offsetHeight - this.offsetHeight)/2);
left:expression((Div.offsetWidth - this.offsetWidth)/2);
}
#Txt p{
font-size:9pt;
margin:8px;
}
#Txt font{
color:#FF0000;
font-size:9pt;
}
#Layer1 {
border:#006699 1px solid;
padding:10px;
font-size:9pt;
color:#336699;
position:absolute;
top:expression((body.clientHeight - this.offsetHeight)/2);
left:expression((body.clientWidth - this.offsetWidth)/2 + Div.offsetWidth);
}
#Layer1 Input {
font-size:9pt;
color:#336699;
}
#Int {
text-align:right;
}
-->
</style>
</head>
<body>
<div id="Div"><span id="Txt">请分别按下 <font>↑</font>、<font>↓</font>、<font>←</font>、<font>→</font>,
试试看有什么效果? </span></div>
<span id="Layer1">控制键设置:
向上移动:
<input name="Up" type="text" value="↑" size="6">
向下移动:
<input name="Down" type="text" value="↓" size="6">
向左移动:
<input name="Left" type="text" value="←" size="6">
向右移动:
<input name="Right" type="text" value="→" size="6">
每次移动 <input name="Int" type="text" id="Int" value="5" size="4" maxlength="3">
px;</span>
</body>
</html>
[1] [2] [3] 下一页