Using the backdrop-filter
css parameter, you can blur the background of a div:
#image {
width:300px;
height:300px;
background: url(https://i.picsum.photos/id/527/300/300.jpg?hmac=wk333ApmV6eJV8v2QbKrGH1urFbDlb2bEt92dWS5Yno);
}
#image div {
position: absolute;
top: 75px;
left: 75px;
width: 150px;
height: 150px;
backdrop-filter: blur(12px);
}
<div id="image">
<div>Blurred</div>
</div>
Using the mask-image
parameter, you can add a gradient mask to fade out an edge:
#image {
width:300px;
height:300px;
background: url(https://i.picsum.photos/id/527/300/300.jpg?hmac=wk333ApmV6eJV8v2QbKrGH1urFbDlb2bEt92dWS5Yno);
}
#image div {
position: absolute;
top: 75px;
left: 75px;
width: 150px;
height: 150px;
backdrop-filter: blur(12px);
mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0));
-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0));
}
<div id="image">
<div>Blurred</div>
</div>
Is there a way to create a blurred square with these faded edges, that can handle being resized? Or a way to receive the same effect with another method?