html写一个有图片背景的登录界面
时间: 2024-06-01 13:09:57 浏览: 12
<!DOCTYPE html>
<html>
<head>
<title>登录界面</title>
<style>
body {
background-image: url('https://www.example.com/background-image.jpg');
background-size: cover;
}
form {
background-color: #fff;
width: 300px;
height: 200px;
margin: 100px auto;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border-radius: 5px;
border: none;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<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>
<input type="submit" value="登录">
</form>
</body>
</html>