Answer the question
In order to leave comments, you need to log in
How to set gradient for SVG on hover?
There is an instagram icon - initially it is white.
But when you hover over it, a gradient with smooth animation should be applied.
I found in Google only how to initially put the gradient. And these are very cumbersome solutions, I expected that everything is simple with SVG.
SVGs are inserted via use
Answer the question
In order to leave comments, you need to log in
One icon on top of another and change the transparency of the top one.
In general, I created a gradient on the page:
<linearGradient id="instagrad" x1="0" y1="100%" x2="100%" y2="0">
<stop class="stop stop--1"
stop-color="#febb26"
offset="0"></stop>
<stop class="stop stop--2"
stop-color="#f74e0b"
offset="33%"></stop>
<stop class="stop stop--2"
stop-color="#de003d"
offset="66%"></stop>
<stop class="stop stop--3"
stop-color="#c0019e"
offset="100%"></stop>
</linearGradient>
&:hover {
svg {
fill: url(#instagrad);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question