用 html5 写一个精致的注册页面
时间: 2024-05-10 15:18:42 浏览: 19
好的,以下是一个简单的注册页面示例:
```
<!DOCTYPE html>
<html>
<head>
<title>注册页面</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>注册</h1>
<p>请填写以下信息完成注册</p>
<form>
<label for="username">用户名</label>
<input type="text" id="username" name="username" required>
<label for="email">邮箱</label>
<input type="email" id="email" name="email" required>
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
<label for="confirm-password">确认密码</label>
<input type="password" id="confirm-password" name="confirm-password" required>
<input type="submit" value="注册">
</form>
</div>
</body>
</html>
```
同时,需要创建一个名为 `style.css` 的样式文件来美化页面,以下是一个简单的样式示例:
```
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.container {
background-color: #fff;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
margin: 50px auto;
padding: 20px;
max-width: 500px;
}
h1 {
text-align: center;
}
label {
display: block;
margin-bottom: 5px;
}
input[type="text"],
input[type="email"],
input[type="password"] {
border: none;
border-radius: 3px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
display: block;
font-size: 16px;
margin-bottom: 10px;
padding: 10px;
width: 100%;
}
input[type="submit"] {
background-color: #007bff;
border: none;
border-radius: 3px;
color: #fff;
cursor: pointer;
font-size: 16px;
padding: 10px;
transition: background-color 0.3s ease;
width: 100%;
}
input[type="submit"]:hover {
background-color: #0062cc;
}
```
这样就完成了一个简单的注册页面,你可以根据自己的需求修改样式和添加更多的表单项。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)