【发布时间】:2021-01-23 21:29:19
【问题描述】:
我可以在由 SVG 蒙版制作的切口内添加阴影吗?
这是我正在使用的代码
index.html
<div class="content">
<section id="home-section">
</section>
...
</div>
styles.css
#home-section {
background: url(img/bg.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
-webkit-mask: url(img/mask.svg) center/contain no-repeat;
-webkit-mask-size: auto;
}
但这是我想要的结果(我已经在 Illustrator 中制作了):
这是 SVG:https://drive.google.com/file/d/1O7nGJHeYkgw9Al9BojSVI7f8zKzv4fbu/view?usp=sharing
【问题讨论】:
-
分享您正在使用的 SVG,以便我们给您准确的答案
-
在您的问题中将 svg 共享为代码。如果您知道如何清洁它。
标签: html css svg shadow css-mask