一、实验目的
掌握表单元素做一个注册页面和登录页面
二、实验内容
1.实验区域
2.功能描述
在这个实验中,可以进行注册,当你注册成功后,会弹出警示框,告诉你注册成功,如果你已经有账号了,直接选择登陆界面,输入正确的形式,就可以弹出来登陆成功。
3.html描述
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>个人注册和登录界面</title>
<link type="text/css" rel="stylesheet" href="css/zhuce.css" />
</head>
<body>
<div class="main">
<form>
<fieldset>
<legend align="center">注册表</legend>
<h3 align="center">如果你还没有注册账号 赶紧注册吧!</h3>
<div align="center">
手 机 号:<input type="text" id="phone"/>
<br />
用 户 名:<input type="text" id="username" name="username" value="请输入喜欢的用户名"/>
<br />
身 份:<select name="card"/>
<option value="学生">学生</option>
<option>家长</option>
<option>老师</option>
</select>
<br />
性 别:<input type="radio" name="sex" checked="checked" value="male"/>男<input type="radio" name="sex" value="female" />女
<br />
密 码:<input type="password" id="pasw" />
<br />
确认密码:<input type="password" id="pasw" />
<br />
验 证 码:<input type="text" id="yanzheng"/>
<br />
<input type="button" id="button" name="button" value="注册" onclick="javascript:alert('注册成功!')" />
</div>
</fieldset>
<fieldset>
<legend align="center">登录表</legend>
<h4 align="center">如果你已注册,请登录!</h4>
<div align="center">
手 机 号:<input type="text" id="phone"/>
<br />
密 码:<input type="password" id="pasw"/>
<br />
<input type="button" id="button" value="登录" onclick="javascript:alert('登录成功!')"/>
</div>
</fieldset>
</form>
</div>
</body>
</html>
4.css描述
legend{
font-size: 35px;
color: deepskyblue;
}
#phone{
border-radius: 5px;
text-align: center;
}
#pasw{
border-radius: 5px;
text-align: center;
}
#username{
border-radius: 5px;
text-align: center;
}
#yanzheng{
border-radius: 5px;
text-align: center;
}
h4{
color: red;
}
.main{
width: 350px;
}
div{
background-color: azure;
}
#button{
margin-top: 20px;
background-color: bisque;
color: red;
width: 118x;
height: 68px;
font-size: 48px;
border-radius: 10px;
border-style: none;
}
三、实验总结
1.实验过程中遇到的问题及解决办法
遇到的问题
1)在选择性别按钮的时候,可以同时选择男和女;
2)分组lengend的时候,里面的文字无法正确居中;
解决的办法
1)给一个其中一个为选中按钮,并且给value值,可以解决;
2)在后面直接使用align=”center”;
2.本次实验过程总结
在此次实验中,学会了用文本框输入内容,学会了设置边框为不显示,这样可以达到美观的效果,设置边框四角弧度可以使整个界面看起来很好看,当你点注册的时候,会弹出注册成功的警示,当你在登录表中,点登录的时候,会提示你登录成功,在这次实验中,把以前觉得有意思的选中,下来列表都实现了。