Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Blur gradient in CSS?

I have a circular div with the following css:

z-index: 9999;
position: absolute;
transform: translate(-50%,-50%);
height: 150px;
width: 150px;
border-radius: 50%;
pointer-events: none;

backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);

How can I add an (opacity?) gradient to this div to make the blur end less abruptly
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Something like this:

body,
html {
  margin: 0px;
  padding: 0px;
  background-color: #000;
  width: 100%;
}

h1 {
  color: #fff;
  font-size: 80px;
  line-height: 120px;
  text-align: center;
}

.blur-mask {
  z-index: 9999;
  position: absolute;
  top: 50px;
  left: calc(50% - 75px);
  height: 150px;
  width: 150px;
  border-radius: 50%;
  pointer-events: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  
  -webkit-mask-image: radial-gradient(circle at 50% 50%, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
}
<h1>LOREM</h1>
<div class="blur-mask"></div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading