编写一个注册的html5页面
时间: 2024-05-10 11:19:33 浏览: 8
以下是一个简单的注册页面示例:
```
<!DOCTYPE html>
<html>
<head>
<title>注册页面</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
background-color: #F7F7F7;
}
form {
background-color: #FFFFFF;
padding: 20px;
max-width: 500px;
margin: 0 auto;
}
input[type=text], input[type=password], input[type=email] {
width: 100%;
padding: 10px;
margin-bottom: 15px;
border: none;
background-color: #F2F2F2;
}
input[type=submit] {
background-color: #4CAF50;
color: #FFFFFF;
padding: 10px;
border: none;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #3E8E41;
}
h2 {
text-align: center;
margin-bottom: 30px;
}
</style>
</head>
<body>
<form>
<h2>注册</h2>
<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>
</body>
</html>
```
该页面包含一个表单,要求用户输入用户名、电子邮件和密码。输入框使用HTML5的input元素,并添加了必填属性。提交按钮使用HTML5的input元素,类型为submit。同时,使用CSS样式美化页面。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.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)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)