html好看的注册和登录页面
时间: 2023-09-02 18:15:45 浏览: 79
以下是一个简单的注册和登录页面的 HTML 代码示例,可以根据自己的喜好进行美化:
```html
<!DOCTYPE html>
<html>
<head>
<title>注册和登录页面</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
form {
background-color: #fff;
max-width: 500px;
margin: 0 auto;
padding: 20px;
box-shadow: 0px 0px 10px #ccc;
border-radius: 5px;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
width: 100%;
}
button:hover {
background-color: #45a049;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
</style>
</head>
<body>
<h2>注册</h2>
<form action="/register" method="post">
<div class="container">
<label for="email"><b>邮箱</b></label>
<input type="text" placeholder="请输入邮箱" name="email" required>
<label for="psw"><b>密码</b></label>
<input type="password" placeholder="请输入密码" name="psw" required>
<label for="psw-repeat"><b>确认密码</b></label>
<input type="password" placeholder="请再次输入密码" name="psw-repeat" required>
<button type="submit">注册</button>
</div>
</form>
<h2>登录</h2>
<form action="/login" method="post">
<div class="container">
<label for="email"><b>邮箱</b></label>
<input type="text" placeholder="请输入邮箱" name="email" required>
<label for="psw"><b>密码</b></label>
<input type="password" placeholder="请输入密码" name="psw" required>
<button type="submit">登录</button>
<label>
<input type="checkbox" checked="checked" name="remember"> 记住我
</label>
</div>
<div class="container" style="background-color:#f1f1f1">
<span class="psw">忘记<a href="#">密码?</a></span>
</div>
</form>
</body>
</html>
```
这是一个基础的样式,你可以根据自己的需要进行修改和美化。
阅读全文