我试图让我的登录表单内的图像不模糊,但保持登录表单外的背景模糊 What I'm trying to do
试用背景滤镜等
.bg-image {
position: fixed;
display: inline-block;
top: 0;
left: 0;
width: 100%;
height: 100%;
transform: scale(1.1);
background-image: url("https://i.ibb.co/DWvpCWD/login-bg.jpg");
filter: blur(3px);
-webkit-filter: blur(3px);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.bg-text {
background-color: rgba(0, 0, 0, 0.7);
color: white;
font-weight: 500;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
padding: 40px;
display: flex;
justify-content: center;
border-radius: 3px;
width: 90%;
max-width: 300px;
}
<div class="bg-image"></div>
<div class="bg-text">
<div class="row">
<div class="login-register">
<a href="/login" class="active">Login</a>
<a href="/register">Register</a>
</div>
<div>
<form action="post" class="form">
<div class="input-group">
<label for="username">Username</label>
<input type="text" name="username">
</div>
<div class="input-group">
<label for="password">Password</label>
<input type="password" name="password">
</div>
<div class="checkbox">
<input class="checkbox-effect checkbox-effect-1" id="get-up-1" type="checkbox" name="remember">
<label for="get-up-1">Remember Me</label>
</div>
<button type="submit">Login</button>
<a class="forgot-password" href="">Forgot Password?</a>
</form>
</div>
</div>
</div>
试图使. bg—text容器后面的图像不模糊