一个简单的注册HTML页面,包含用户名、一次密码、二次密码、email、手机和微信号,使用现代样式,并将按钮居中。样式与HTML分开
时间: 2023-05-19 20:05:40 浏览: 54
非常感谢您的提问!以下是一个简单的注册HTML页面,包含用户名、一次密码、二次密码、email、手机和微信号,使用现代样式,并将按钮居中。样式与HTML分开:
HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<title>注册页面</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<h1>注册</h1>
<form>
<label for="username">用户名</label>
<input type="text" id="username" name="username" 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>
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="phone">手机</label>
<input type="tel" id="phone" name="phone" required>
<label for="wechat">微信号</label>
<input type="text" id="wechat" name="wechat" required>
<button type="submit">注册</button>
</form>
</div>
</body>
</html>
```
CSS代码:
```
.container {
max-width: 500px;
margin: 0 auto;
padding: 20px;
background-color: #f2f2f2;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
h1 {
text-align: center;
margin-bottom: 20px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 10px;
}
input {
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
border: none;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
button {
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
margin: 0 auto;
display: block;
}
```
希望这个回答能够帮到您!