使用https://cdn.pixabay.com/photo/2023/03/15/03/46/jeep-7853620_960_720.jpg这个地址的图片为背景,生成一个web登陆界面
时间: 2023-05-15 14:07:35 浏览: 235
官网http://jquerycom-JQurey语法实用
好的,我可以为您生成一个基于该图片的Web登录界面。以下是HTML和CSS代码:
HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<title>Web登录界面</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="login-box">
<img src="https://cdn.pixabay.com/photo/2023/03/15/03/46/jeep-7853620_960_720.jpg" class="avatar">
<h1>登录</h1>
<form>
<p>用户名</p>
<input type="text" name="username" placeholder="请输入用户名">
<p>密码</p>
<input type="password" name="password" placeholder="请输入密码">
<input type="submit" name="submit" value="登录">
<a href="#">忘记密码?</a>
</form>
</div>
</body>
</html>
```
CSS代码:
```
body {
margin: 0;
padding: 0;
background: url(https://cdn.pixabay.com/photo/2023/03/15/03/46/jeep-7853620_960_720.jpg) no-repeat center center fixed;
background-size: cover;
font-family: sans-serif;
}
.login-box {
width: 320px;
height: 420px;
background: rgba(0, 0, 0, 0.5);
color: #fff;
top: 50%;
left: 50%;
position: absolute;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding: 70px 30px;
}
.avatar {
width: 100px;
height: 100px;
border-radius: 50%;
position: absolute;
top: -50px;
left: calc(50% - 50px);
}
h1 {
margin: 0;
padding: 0 0 20px;
text-align: center;
font-size: 22px;
}
.login-box p {
margin: 0;
padding: 0;
font-weight: bold;
}
.login-box input {
width: 100%;
margin-bottom: 20px;
}
.login-box input[type="text"], input[type="password"] {
border: none;
border-bottom: 1px solid #fff;
background: transparent;
outline: none;
height: 40px;
color: #fff;
font-size: 16px;
}
.login-box input[type="submit"] {
border: none;
outline: none;
height: 40px;
background: #1c8adb;
color: #fff;
font-size: 18px;
border-radius: 20px;
}
.login-box input[type="submit"]:hover {
cursor: pointer;
background: #39dc79;
color: #000;
}
.login-box a {
text-decoration: none;
font-size: 14px;
color: #fff;
}
.login-box a:hover {
color: #39dc79;
}
```
您可以将以上代码保存为HTML和CSS文件,然后在浏览器中打开HTML文件以查看效果。
阅读全文