微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何让子 div 出现在父 div 中的 css 掩码上方

如何解决如何让子 div 出现在父 div 中的 css 掩码上方

我已将 svg 掩码应用于使用 Gutenberg 封面块创建的 mp4 视频。问题是 wp-block-cover__inner-container 文本也被 svg 屏蔽了,但需要出现在它上面。

我尝试使用以下答案来解决我的问题,但我不是专业人士,无法这样做:How to apply a mask-image only on an element's background and not on its children?

网址:https://net0kitchen.com/393-2

CSS:

.waves-video {
mask-repeat: no-repeat;
mask-position: center center;
-webkit-mask-image: url(https://net0kitchen.com/wp-content/uploads/2021/07/netzerokitchen-–-doughnut-01-1.svg);
-webkit-mask-repeat: no-repeat;
-webkit-mask-position: center center;
}

.doughnut-text {
text-align: center;
padding: 20px;
margin: auto;
background: red;
color: white;
}

非常感谢任何帮助。

解决方法

只需将蒙版样式从 .waves-video 移至 .wp-block-cover__video-background

mask on video only

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。