注册页面:
一个简单的注册页面,主要为表单和表格给的运用,及相关css知识的练习
运行出网页
html代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="user.css">
</head>
<body>
<div class="content">
<form action="" method="post">
<!-- 头部 -->
<div class="bt">
<div class="left">
<a href="#">新用户注册</a>
<p>USER REGISIER</p>
</div>
<div class="right">
请<a href="#">登录</a>
</div>
</div>
<!-- 表单 -->
<div class="br">
<table>
<tr>
<td>姓名:</td>
<td>
<input type="text">
</td>
</tr>
<tr>
<td>年龄</td>
<td>
<input type="number">
</td>
</tr>
<tr>
<td>电话:</td>
<td>
<input type="tel">
</td>
</tr>
<tr>
<td>密码:</td>
<td>
<input type="password">
</td>
</tr>
<tr>
<td>地址:</td>
<td><input type="text"></td>
</tr>
<tr>
<td>生日</td>
<td>
<input type="date">
</td>
</tr>
<tr>
<td>性别:</td>
<td>
男<input type="radio" name="sex">
女<input type="radio" name="sex">
</td>
</tr>
<tr>
<td>建议:</td>
<td>
<input type="text" class="qustion">
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="注册" class="regin">
</td>
</tr>
</table>
</div>
</form>
</div>
</body>
</html>
css代码:
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body{
background: url(img/add_back.jpg);
}
form{
margin: 100px auto;
width: 500px;
height: 600px;
background: url(img/add_bake01.png) no-repeat;
padding: 10px 10px 0 40px;
border-radius: 15px;
box-shadow: 2px 2px 2px 2px #000;
}
a{
text-decoration: none;
}
.bt .left{
float: left;
color: white;
font-size: 12px;
font-weight: 400;
}
.left a{
color: rgb(117, 201, 235);
font-size: 20px;
font-weight: 700;
}
.right{
float: right;
font-size: 20px;
}
.right a{
color: red;
font-size: 14px;
}
.br{
margin:150px 100px;
}
tr :nth-child(1){
color: #fff;
}
td .regin{
margin-top: 40px;
width: 100px;
height: 40px;
background-color: rgb(65, 138, 235);
outline: none;
border-radius: 10px;
}
小结:
不管是简单的网页还是比较复杂的,个人认为先写结构在慢慢用css美化会更容易上手。(希望会大家有帮助)