I'm currently building the main page of my app. I want a simple blurry background with login button visible. I used blur(1px)
but I can't manage to make it blur only on background. It blurs the entire page.
body, html {
height: 100%;
}
* {
box-sizing: border-box;
}
.hero.is-info {
filter: blur(1px);
-webkit-filter: blur(1px);
background: linear-gradient(
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5)
), url('https://unsplash.it/1200/900?random') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.login{
z-index: 2;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Hello</title>
<link
rel="stylesheet"
href="https://jenil.github.io/bulmaswatch/litera/bulmaswatch.min.css"
/>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<div class="section hero is-info is-fullheight has-text-centered">
<div class="hero-body login">
<div class="container">
<h1 class="title">Title</h1>
<div id="root"></div>
</div>
</div>
</div>
</body>
</html>