【发布时间】:2018-02-20 14:12:36
【问题描述】:
CSS 中是否有替代背景过滤器的方法? 为了让这个例子正常工作,我必须启用chrome://flags/#enable-experimental-web-platform-features
body {
background: url('http://verdewall.com/wp-content/uploads/2016/08/Background-Images-4H9.jpg') no-repeat center;
}
.glass {
width: 100%;
height: 500px;
background: rgba(0,0,0,0.8);
-webkit-backdrop-filter: contrast(4) blur(30px);
backdrop-filter: contrast(4) blur(30px);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Blur</title>
</head>
<body>
<div class="glass">
</div>
</body>
</html>
问题是它下面的内容将是动态的。因此,并非所有这些都是图像,而我发现的替代方案仅适用于图像。就像这里显示的带有模糊的半透明:
【问题讨论】:
-
也许您可以为无法看到此内容的人显示结果的屏幕截图
-
@TemaniAfif 我已经尝试过这种方法,尽管它不针对 div 下方的内容,就像针对某个区域的各种掩码。
-
@Jonny 不幸的是同样的问题。
标签: javascript css