A
A
Aleksandr2018-10-17 14:28:02
css
Aleksandr, 2018-10-17 14:28:02

Change svg background color?

Example
How can I make the background of the text appear on hover?
that is, brought - the background is translucent and vidosik

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Abdula Magomedov, 2018-10-17
@Sashjkeee

Just like other elements.
Specifically in your case:

let rect = document.querySelector('#mask > rect');
rect.style.fill = "rgba(255, 255, 255, 0.30)";

UPD. I did not immediately understand the question. Actually, I didn't read the first line. Here:
svg:hover #mask > text {
    fill: rgb(125,125,125);
}

add the necessary selectors, and do it beautifully. Here I just showed the possibilities of css.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question