HTML personal settings center with the avatar as the background similar to the masking effect

Share a special effect, the principle is very simple.

-webkit-filter: CSS filter property, which can provide some effects for the rendering of the element before the element is rendered, such as blurring, color transfer and so on. Filters are often used to adjust the rendering of images, backgrounds, and borders.

Code:

<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-control" content="private, must-revalidate" />
<title></title>
</head>
<style>
   *{margin: 0px;padding: 0px;}
    .to{width:500px;height:500px;border-radius:500px;overflow:hidden;position:absolute;
   //Absolute positioning, does not occupy the position
   top:50%;
   left: 50%;
   margin-top: -250px;
   margin-left: -250px;
   }
</style>
<body>
<img style="position: absolute;-webkit-filter:blur(40px);opacity:0.4;width:100%;
     height:100%;" src="1.jpg">
<div class="to">
<img style="margin-left:-950px;" src="1.jpg">
</div>
</body>
</html>

 

It can be made into a personal setting center background, the effect is very beautiful

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326082330&siteId=291194637