具有透明度的 CSS 模糊背景(就像在 iOS7 中一样)

标签 css background filter transparent blur

这适用于固定在顶部且主体的其余部分在其下方滚动的网站标题。

到目前为止,我设法让透明度发挥作用;但是,我确实想模糊标题的背景,因此当其余内容在其下方滚动时,内容看起来很模糊。这可能吗?

我试图实现的外观就像在 iOS 7 上一样。它们的新工具栏具有相同的效果。

#headerWrapperBackground {
    width: 100%;
    height: 100px;
    z-index: 9998;
    position: fixed;
    background-color: #222;
    background-color: rgba(34, 34, 34, 0.95);

}

#headerWrapper {
    background-color: transparent;
    margin: auto;
    text-align: center;
    position: fixed;
    z-index: 9999;
    width: 100%;
    box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 5px 3px;
}

最佳答案

试试这个

<svg height="110" width="110">
  <defs>
    <filter id="f1" x="0" y="0">
      <feGaussianBlur in="SourceGraphic" stdDeviation="15" />
    </filter>
  </defs>
  <rect width="90" height="90" stroke="green" stroke-width="3" fill="gray" filter="url(#f1)" />
</svg>

关于具有透明度的 CSS 模糊背景(就像在 iOS7 中一样),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23925792/

相关文章:

javascript - 如何在 Angular 中使用大写过滤器?

performance - Git - 在克隆之前/之后过滤

CSS 水平子菜单 - IS 6,7 都不起作用,尝试使用任何悬停

html - anchor 内的图像会导致错位

java - 单击时更改按钮颜色

winforms - 过滤 WinForm DataGridView

html - 如何垂直对齐到 x 高度?

php - 如何编辑 php 文件并在多列中返回 wordpress 博客条目?

iphone - 无法更改选定状态的自定义 uiButton 的背景图像

java - 如何让我的应用程序永远运行,甚至在后台运行