I have two SVG in a HTML file. but the problem is I can't give a different gradient to them. the second SVG is filled with the first svg's gradient color.
First svg
:
<div class="wave">
<svg id="svg" viewBox="0 0 1440 400" xmlns="http://www.w3.org/2000/svg" class="transition duration-300 ease-in-out delay-150">
<defs>
<linearGradient id="gradient">
<stop offset="5%" stop-color="#7f00ffff"></stop>
<stop offset="95%" stop-color="#e100ffff"></stop>
</linearGradient>
</defs>
<path
d="M 0,400 C 0,400 0,200 0,200 C 199.86666666666667,226.8 399.73333333333335,253.6 559,240 C 718.2666666666667,226.4 836.9333333333334,172.4 977,159 C 1117.0666666666666,145.6 1278.5333333333333,172.8 1440,200 C 1440,200 1440,400 1440,400 Z"
stroke="none"
stroke-width="0"
fill="url(#gradient)"
class="transition-all duration-300 ease-in-out delay-150"
transform="rotate(-180 720 200)"
></path>
</svg>
</div>
Second svg
:
<div class="wave">
<svg id="svg" viewBox="0 0 1440 400" xmlns="http://www.w3.org/2000/svg" class="transition duration-300 ease-in-out delay-150">
<defs>
<linearGradient id="gradient">
<stop offset="5%" stop-color="red"></stop>
<stop offset="95%" stop-color="green"></stop>
</linearGradient>
</defs>
<path
d="M 0,400 C 0,400 0,200 0,200 C 199.86666666666667,226.8 399.73333333333335,253.6 559,240 C 718.2666666666667,226.4 836.9333333333334,172.4 977,159 C 1117.0666666666666,145.6 1278.5333333333333,172.8 1440,200 C 1440,200 1440,400 1440,400 Z"
stroke="none"
stroke-width="0"
fill="url(#gradient)"
class="transition-all duration-300 ease-in-out delay-150"
transform="rotate(-180 720 200)"
></path>
</svg>
</div>
in the second svg I give red and green gradiant. but it is not applied. why It is this happening?