I want to put blur filter on the background image in this Bootstrap template but that results in the child divs also getting blurred. I followed this solution, and it works on desktop, but it does not work on mobile. The text is shifted to the top and is cut off by the navigation bar and the bottom of the header is cut off, all because of top/bottom/left/right positioning I'm adding. Here's what I have:
The HTML:
<header class="masthead text-center text-white d-flex">
<div class='masthead-img'></div>
<div class="container my-auto" style='z-index: 100;'>
<!-- everything else is the same as what's in the template -->
...
This is based off this code
The CSS:
/* comment out header.masthead */
.masthead-img {
padding-top: 10rem;
padding-bottom: calc(10rem - 56px);
background-image: url("../img/header.jpg");
background-position: center center;
background-size: cover;
z-index: 10;
filter: blur(1px);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1;
}
This is based off this code
<header class="masthead text-center text-white d-flex">
<div class='masthead-img'></div> <!-- my addition -->
...
</header>