Hover a css icon width other color inside wp_get_attachment_image

I'm using ACF and have inside a loop: ?php echo wp_get_attachment_image( $button_image, 'small', 'sidebar-btn-icon', [class = sidebar-btn-icon , alt= sidebar icons]); ? This shows a svg icon.

fill: #eee doesn't work because there is no direct path.

Now I'm wondering how the change the color after a hover action?

Topic svg icon loop images Wordpress

Category Web


On :hover you should change the svg-image, not the color. The second image is a copy with a different color. For example, if your image is shown in the background, you can change the style in this way:

.sidebar-btn-icon:hover {
    background-image: url(button_image_red.svg');
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.