我想要重现以下风格

enter image description here

我想出了以下几点

enter image description here

问题是,切割不会影响模糊滤镜,我不知道如何解决它.这是我的HTML码:

.glass {
    width: 40%;
    height: 100%;
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(50px);
    z-index: 0;
    mix-blend-mode: screen;
    margin-left: auto;
    margin-right: auto;
}

.afri {
    position: absolute;
    top: 410px;
    left: 54%;
}
<div className="glass">
    <div className="trips">
        <h3>AMAZING TRIPS</h3>
    </div>
    <div className="afri">
        <h1>AFRI</h1>
    </div>
</div>

我try 了背景滤镜和混合混合模式:屏幕.我本以为会被砍个满额

推荐答案

您可以使用MASK来实现这一点,但目前仅在Chrome上提供:

.box {
  /* this will do the trick */
  -webkit-mask:
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0);
  -webkit-mask-clip: text, padding-box;
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  /**/
  backdrop-filter: blur(8px);
  text-transform: uppercase;
  font-size: 80px;
  font-weight: bold;
  background: rgb(0 0 0/50%);
  padding: 20px;
}

body {
  background:url(https://picsum.photos/id/1016/800/300) center/cover;
  padding: 50px 0;
}

html {
  background: #fff;
}
<div class="box">Text</div>

Html相关问答推荐

我已经在我的网站上创建了按钮,但我不能让它们正确排列.'

为所有必填字段添加所需的占位符文本(Angular Material)

邮箱追踪器-有效,但在Gmail客户端中是否可以显示问号图标以外的其他内容?

覆盖垫子中的边框底部 Select

当溢出到滚动条中时, bootstrap 按钮样式会更改

使用响应迅速的网格系统,将两列保持在同一行,同时允许更多列用于更大的屏幕

穿过整个屏幕的旋转线

我的Django应用程序中出现模板语法错误

如何解决水平塌陷问题?

我如何确保我的网格永远不会小于它的子网格

Swift 以编程方式在 YouTube 嵌入视频中进入全屏

当底部进入视图时从底部粘性定位

高度大于页面高度和页面大于覆盖的 CSS 覆盖

导航丸被选中(活动),但内容未显示.怎么会?

如何在滚动行中显示一张图片和下一张图片的一半?

悬停一个 div 时更改所有其他 div 上的字体 colored颜色

flex-box 中的图像在 Chrome 和 Firefox 中看起来不同 - 如何使它们在 Firefox 中看起来像?

如何将我的输入值固定到 2022 年 12 月?

使用 bootstrap-icons 的未排序图标堆栈

根据正则表达式 attr 从 read_html 过滤表格