如何模糊该部分下方的 div,从而将该效果应用于该部分及其内容(想要获得没有背景图像的 OSX Yosemite 模糊效果)。
这是标记。
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
section{
display: table;
position: relative;
background: rgba(255,0,0,0.5);
width: 300px;
height: 100px;
}
section h1{
display: table-cell;
vertical-align: middle;
text-align: center;
color: #fff;
}
div{
position: absolute;
top: 30px;
left: 10px;
width: 300px;
height: 100px;
background: rgba(255,255,255,0.5);
filter: blur(4px);
}
</style>
</head>
<body>
<section>
<h1>There is some content</h1>
</section>
<div></div>
</body>
</html>
最佳答案
我看到你有 filter: blur
。我也用它做了一些测试,但无法让它在 firefox 31 中工作。似乎 text-shadow
应该完成类似的事情。
.blurred {
color: transparent;
text-shadow: 0 0 5px rgba(0,0,0,0.5);
}
关于html - 如何在没有背景图像的情况下使用 CSS 3 模糊部分下方的 div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28932142/