2

Как через :hover менять цвет svg иконки?

1

1 ответ 1

4

Можно использовать css-свойство fill:

svg:hover {
  fill: цвет;
}

Сниппет:

svg:hover {
  fill: teal;
}

svg {
  width: 50vmin;
  height: 50vmin;
}
<svg viewBox="0 0 24 24">
    <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
    <path d="M0 0h24v24H0z" fill="none"/>
</svg>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.