web设计登陆页面带图片
时间: 2023-10-05 09:08:27 浏览: 36
首先,你需要选择一张适合作为背景的图片。可以选择一张高清大气的图片,或者是一张与你网站主题相关的图片。接下来,你可以使用CSS来实现带图片的登陆页面。
以下是一个简单的示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
body {
background-image: url("your-image.jpg");
background-size: cover;
background-position: center;
}
.login-form {
background-color: rgba(255, 255, 255, 0.8);
border-radius: 10px;
padding: 20px;
width: 400px;
margin: 100px auto;
text-align: center;
}
input[type="text"], input[type="password"] {
padding: 10px;
margin: 10px;
border-radius: 5px;
border: none;
width: 80%;
font-size: 16px;
}
input[type="submit"] {
background-color: #4caf50;
color: white;
padding: 10px 20px;
margin: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
transition: all 0.3s ease;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<div class="login-form">
<h2>Login</h2>
<form>
<input type="text" placeholder="Username"><br>
<input type="password" placeholder="Password"><br>
<input type="submit" value="Login">
</form>
</div>
</body>
</html>
```
在上面的代码中,`background-image` 属性用于设置页面背景图片,`background-size` 属性用于控制图片在页面中的大小,`background-position` 属性用于控制图片的位置。`.login-form` 类的样式用于设置登陆表单的样式,包括背景颜色、圆角、内边距、宽度和居中等。`input` 标签的样式用于设置表单输入框和提交按钮的样式。你可以根据自己的需要修改这些样式,以适应你的网站主题和需求。