Home >Web Front-end >CSS Tutorial >A brief discussion on how to achieve frosted glass effect with css

A brief discussion on how to achieve frosted glass effect with css

青灯夜游
青灯夜游forward
2021-05-08 10:30:443435browse

This article will let you know how to use css to achieve the frosted glass effect? It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

A brief discussion on how to achieve frosted glass effect with css

I saw the frosted glass effect of a floating menu on Apple’s official website

A brief discussion on how to achieve frosted glass effect with css

I was fascinated by this effect I was attracted, and after digging into the source code, I found that this effect can be achieved through only two CSS properties.

Apple website address https://www.apple.com.cn/macos/big-sur/. If you are interested, you can check it out. There are some more interesting special effects on it. I have to say Apple’s page The experience is really well done, you can study it if you are interested.

Key css attributes

background: rgba(29,29,31,0.72);

Add a background color with a transparency of 0.72

backdrop-filter: saturate(180%) blur(20px);

backdrop-filter Add a filter behind the element, Instead of elements, two filters saturate and blur

## are added here. For more programming-related knowledge, please visit:

Programming Video! !

The above is the detailed content of A brief discussion on how to achieve frosted glass effect with css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete