Sha*_*hid 11 css svg linear-gradients
如何将线性渐变和阴影应用于此图案?
<svg viewbox="0 0 60 10">
<pattern x="-8" id="waves" patternUnits="userSpaceOnUse" width="10" height="10">
<path d="M0 10 V5 Q2.5 3.5 5 5 T10 5 V10" fill="#FFC338" />
</pattern>
<rect x="0" y="0" width="60" height="7" fill="url(#waves)" />
</svg>Run Code Online (Sandbox Code Playgroud)
web*_*iki 18
正如Paul LeBeau评论的那样,您需要将波浪形状转换为一条路径,然后您可以使用线性渐变填充波浪形状,如下例所示:
<svg viewbox="7.5 0 60 10">
<defs>
<linearGradient id="gradient">
<stop offset="5%" stop-color="#FFC338" />
<stop offset="95%" stop-color="#FFEA68" />
</linearGradient>
</defs>
<path fill="url(#gradient)" d="M0 10 V5 Q2.5 2.5 5 5 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 t5 0 V10" />
</svg>Run Code Online (Sandbox Code Playgroud)