css - 如何在 CSS 中显示文本蒙版后面的动画?
问题描述
我最近遇到了一个很酷的效果,开发人员在 CSS 中显示了一个被文本屏蔽的动画。您可以在此页面的标题上找到它:https ://www.adobe.com/products/xd/features/whats-new.html
你如何做到这一点?
解决方案
经过一番调查后发现,它实际上非常简单:
您只需将 SVG 动画作为背景放入周围的容器中,然后在文本上使用 {mix-blend-mode: lighten;} 和 {background: white} :
.container {
background: url(https://www.adobe.com/content/dam/cc/us/en/products/xd/features/knockout_animation.svg);
}
.container h1 {
mix-blend-mode: lighten;
background: white;
}
推荐阅读
- python - 错误:[Index(['...'], dtype='object')] 中没有一个在 [index] 中
- java - 带有浮动操作按钮的 Android 导航抽屉
- python - 如何将 pandas 3 列数据框中的列转换为 Python 中的矩阵格式?
- spring - 如何在 JPQL RestRepository 中过滤加入
- rest - 不存在的对象的 GraphQL 查询结果
- go - go protobuf:找不到包“。” 在 github.com/gogo/protobuf/proto 和 m.TimeStamp.MarshalToSizedBuffer 中未定义
- sql - 我真的不明白出了什么问题
- c# - c#中的秒表(统一)
- vim - 获取“按 ENTER 或键入命令继续”,有关如何解决的任何提示?
- c++ - 为什么未删除的文件指向无效的 NTFS MFT 记录?