用html制作一个较为复杂的登陆界面
时间: 2024-02-16 20:12:39 浏览: 27
好的,下面是一个简单的登陆界面示例,包含用户名、密码和验证码的输入框、记住密码和忘记密码功能以及登录按钮。
```html
<!DOCTYPE html>
<html>
<head>
<title>登陆界面</title>
<meta charset="UTF-8">
<style type="text/css">
body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
}
.container {
margin: 100px auto;
max-width: 500px;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
label {
display: block;
margin-bottom: 10px;
font-size: 16px;
font-weight: bold;
}
input[type="text"], input[type="password"], input[type="email"] {
display: block;
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 20px;
font-size: 16px;
box-sizing: border-box;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
margin-top: 20px;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
.remember-me {
display: inline-block;
margin-bottom: 20px;
font-size: 16px;
line-height: 20px;
vertical-align: middle;
}
.forgot-password {
display: inline-block;
margin-left: 20px;
font-size: 16px;
line-height: 20px;
vertical-align: middle;
color: #666;
text-decoration: none;
}
.forgot-password:hover {
color: #333;
}
.captcha {
display: inline-block;
margin-bottom: 20px;
margin-right: 10px;
vertical-align: middle;
}
.captcha-img {
vertical-align: middle;
}
</style>
</head>
<body>
<div class="container">
<h1>登陆</h1>
<form>
<label for="username">用户名</label>
<input type="text" id="username" name="username" required>
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
<div class="captcha">
<label for="captcha">验证码</label>
<input type="text" id="captcha" name="captcha" required>
<img src="captcha.jpg" alt="验证码" class="captcha-img">
</div>
<input type="checkbox" id="remember-me" name="remember-me" class="remember-me">
<label for="remember-me" class="remember-me">记住密码</label>
<a href="#" class="forgot-password">忘记密码?</a>
<input type="submit" value="登陆">
</form>
</div>
</body>
</html>
```
注:此示例中的验证码图片需要你自己生成,并将其命名为captcha.jpg并放在与html文件相同的目录下。