D
D
DeniSidorenko2019-03-08 14:45:40
SVG
DeniSidorenko, 2019-03-08 14:45:40

How to put for SVG instead of fill - gradient?

Good afternoon, to change the color in svg, the FIll property is used. How to set Gradient instead of Fill

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RAX7, 2019-03-08
@DeniSidorenko

<svg>
  <!-- Градиент -->
  <linearGradient id="linear-gradient">
    <stop offset="0%" stop-color="gold"/>
    <stop offset="100%" stop-color="teal"/>
  </linearGradient>

  <!-- Фигура с градиентной заливкой -->
  <rect fill="url(#linear-gradient)"
        width="100%" height="100%"/>
</svg>

css.yoksel.ru/svg-gradients

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question