html移动端登录页面
时间: 2023-11-21 22:57:10 浏览: 35
以下是一个简单的HTML移动端登录页面的示例:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录页面</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.container {
margin: 0 auto;
max-width: 400px;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
h1 {
text-align: center;
margin-bottom: 30px;
}
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;
}
.cancelbtn {
background-color: #f44336;
}
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
position: relative;
}
img.avatar {
width: 40%;
border-radius: 50%;
}
.container > p {
text-align: center;
}
span.psw {
float: right;
padding-top: 16px;
}
@media screen and (max-width: 600px) {
.container {
max-width: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<h1>登录</h1>
<form action="/login" method="post">
<div class="imgcontainer">
<img src="avatar.png" alt="Avatar" class="avatar">
</div>
<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>
<label>
<input type="checkbox" checked="checked" name="remember"> 记住我
</label>
</form>
<p>还没有账号?<a href="#">立即注册</a></p>
</div>
</body>
</html>
```