I’ve got a full screen snap scrolling HTML page which has different topics beneath eachother; you are able to access these by scrolling down.
The different categories have different background images which are set using the background-image: url("image.png")
tag.
Here is my code:
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<style>
body, html {
height: 100%;
}
body {
background-color: black;
}
.slides {
height: 100%;
overflow: scroll;
overflow-x: hidden;
scroll-snap-type: y mandatory;
}
.slide {
height: 100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
scroll-snap-align: start;
}
.home {
background-image: url("/img/bg.jpg");
}
.band {
background-image: url("/img/bg2.jpg");
}
.pictures {
background-image: url("/img/bg3.jpg");
}
</style>
</head>
<body>
<div class="slides">
<div class="slide home"></div>
<div class="slide band"></div>
<div class="slide pictures"></div>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</html>
When I want to apply a filter using
filter: brightness(60%) blur(4px);
-webkit-filter: brightness(60%) blur(4px);
it blurres all child elements in the div instead of the background image.
I’ve already tried backdrop-filter
but never got that to work.
2
Answers
You could put the background in a pseudo element, like this
I have modified your css code, please try to use, I hope your problem will be solved.