html注册登录界面代码
时间: 2023-08-11 18:04:11 浏览: 34
以下是一个基本的 HTML 注册登录界面的代码:
```HTML
<!DOCTYPE html>
<html>
<head>
<title>注册登录界面</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
background-color: #f2f2f2;
font-family: Arial, Helvetica, sans-serif;
}
form {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
margin: 50px auto;
padding: 20px;
max-width: 500px;
}
h2 {
text-align: center;
}
input[type=text], input[type=password] {
display: block;
margin: 20px auto;
padding: 10px;
width: 80%;
border-radius: 5px;
border: none;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
input[type=submit] {
background-color: #008CBA;
border: none;
color: #fff;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #006d9b;
}
</style>
</head>
<body>
<form>
<h2>注册</h2>
<label for="username">用户名</label>
<input type="text" id="username" name="username">
<label for="password">密码</label>
<input type="password" id="password" name="password">
<label for="confirm_password">确认密码</label>
<input type="password" id="confirm_password" name="confirm_password">
<input type="submit" value="注册">
</form>
<form>
<h2>登录</h2>
<label for="login_username">用户名</label>
<input type="text" id="login_username" name="login_username">
<label for="login_password">密码</label>
<input type="password" id="login_password" name="login_password">
<input type="submit" value="登录">
</form>
</body>
</html>
```
这段代码实现了一个简单的注册和登录界面,其中包括两个 HTML 表单:一个用于注册,一个用于登录。表单中包括了输入用户名、密码和确认密码的文本框,以及提交按钮。用户填写完表单后,可以点击提交按钮将表单的数据发送到后端进行处理。