Is that the result you are looking for?
All i did was to create a div around the bg-image2
and profilePicture
, so that the blur on bg-image2
doesn’t affect profilePicture
, then set that div to position:relative;
, so that the profilePicture
can be placed in the middle like you did.
Here is your HTML edited:
<div class="bg-image"></div> <div class="bg-text"> <h1>My name is Stackoverflow</h1> <p>And I am a website</p> </div> <div class="bg-test"> <div class="bg-image2"> <!-- This is the part where I want my stuff to not be blurred and focus --> </div> <div class="profilePicture"> <img src="https://images.pexels.com/photos/1253661/pexels-photo-1253661.jpeg?cs=srgb&dl=android-wallpaper-bluhen-blume-1253661.jpg&fm=jpg" style="width: 170px; height: 170px; border-radius:50%;"> <h1>This is a title</h1> <p>This is just a paragraph</p> </div> </div>
And the CSS:
body, html { height: 100%; } * { box-sizing: border-box; } .bg-image { /* The image used */ background-image: url("https://images.unsplash.com/photo-1507608616759-54f48f0af0ee?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80"); /* Add the blur effect */ filter: blur(8px); -webkit-filter: blur(8px); /* Full height */ height: 100%; /* Center and scale the image nicely */ background-position: center; background-repeat: no-repeat; background-size: cover; } /* Position text in the middle of the page/image */ .bg-test { position:relative; } .bg-text { background-color: rgb(0, 0, 0); /* Fallback color */ background-color: rgba(0, 0, 0, 0.4); /* Black w/opacity/see-through */