写一个html登录页面
时间: 2023-07-25 12:11:35 浏览: 40
下面是一个简单的HTML登录页面的代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #f1f1f1;
}
.container {
padding: 16px;
background-color: white;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
max-width: 500px;
margin: auto;
margin-top: 50px;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
border-radius: 4px;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
border-radius: 4px;
}
button:hover {
background-color: #45a049;
}
.cancelbtn {
background-color: #f44336;
}
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
}
img.avatar {
width: 40%;
border-radius: 50%;
}
.container > label {
font-weight: bold;
display: block;
margin-bottom: 10px;
}
.container > span {
color: red;
display: block;
margin-top: 5px;
margin-bottom: 5px;
}
.container > hr {
border: 1px solid #f1f1f1;
margin-bottom: 15px;
}
.footer {
background-color: #f1f1f1;
padding: 10px;
text-align: center;
margin-top: 30px;
}
</style>
</head>
<body>
<div class="container">
<form>
<div class="imgcontainer">
<img src="avatar.png" alt="Avatar" class="avatar">
</div>
<label for="username"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="username" required>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password" required>
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
<hr>
<span>Forgot <a href="#">password?</a></span>
</form>
</div>
<div class="footer">
<p>Footer text goes here</p>
</div>
</body>
</html>
```
注意:这只是一个基础的HTML登录页面,需要配合后端逻辑实现完整的登录功能。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.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)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)