写一个登录界面html代码要有注册和忘记密码
时间: 2023-09-26 20:08:59 浏览: 55
以下是一个简单的登录界面HTML代码,包括注册和忘记密码功能:
```html
<!DOCTYPE html>
<html>
<head>
<title>登录</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: #f2f2f2;
}
.container {
margin: 20px auto;
max-width: 500px;
padding: 20px;
background-color: #ffffff;
border-radius: 5px;
box-shadow: 0 0 10px #888888;
}
h1 {
text-align: center;
color: #333333;
}
form {
margin-top: 20px;
}
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;
}
.register {
text-align: right;
margin-top: 10px;
}
.forgot-password {
text-align: center;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>登录</h1>
<form>
<label for="username"><b>用户名</b></label>
<input type="text" placeholder="请输入用户名" name="username" required>
<label for="password"><b>密码</b></label>
<input type="password" placeholder="请输入密码" name="password" required>
<button type="submit">登录</button>
<div class="register">
<p>还没有账号?<a href="#">注册</a></p>
</div>
<div class="forgot-password">
<p>忘记密码?<a href="#">重置密码</a></p>
</div>
</form>
</div>
</body>
</html>
```
以上代码中,包含了一个简单的登录表单和两个链接,一个用于注册,另一个用于找回密码。可以根据需要进行修改。