im using the modern ui icons pack in my project using the svg path.
what i try to do is to change the fill color on hover .
but i have no success..
hope someone help me out with this .
Thanks in advance.
Code:
<div id="Main"> <ul> <li> <form> <button> <div class="inner"> <svg> <path d="M35.......etc.."> </path> </svg> </div> </button> </form> </li> </ul> </div
Target the . icon class in CSS and set the SVG fill property on the hover state to swap colors. This is by far the easiest way to apply a colored hover state to an SVG.
You can't change the color of an image that way. If you load SVG as an image, you can't change how it is displayed using CSS or Javascript in the browser. If you want to change your SVG image, you have to load it using <object> , <iframe> or using <svg> inline.
You can overwrite svg fill color via css like below and also target different elements like <path>
polygon
circle
etc.
#Main svg:hover { fill: #fce57e; } #Main svg:hover path { fill: #fce57e; } #Main svg:hover plygon { fill: #fce57e; } #Main svg:hover circle { fill: #fce57e; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With