Home ยป SVG animation resets on hover CSSTricks CSSTricks
SVG animation resets on hover CSSTricks CSSTricks
May 19, 2024
SVG animation resets on hover CSSTricks CSSTricks
Target the .icon class in CSS and set the SVG fill property on the hover state to swap colors. .icon:hover { fill: #DA4567; } This is by far the easiest way to apply a colored hover state to an SVG. Three lines of code! SVGs can also be referenced using an tag or as a background image.
2 Answers Sorted by: 6 With a SMIL animation, this is possible without any scripting. It morphs the cubic bezier path from straight to curved and back. The animation is triggered by mouseover and mouseout events over a transparent rectangle that sits on top of the line.
Animate Svg Path On Hover / Https Encrypted Tbn0 Gstatic Com Images Q Tbn
Jul 12, 2022 โ 8 min read How to animate SVG with CSS: Tutorial with examples Hope Armstrong Product Designer at Treehouse. Animal advocate. Vegan. Painter. Former troll collector. Into lowering waste Table of contents Common use cases for animating SVG with CSS Icons Illustrations How to prepare SVGs for animation Optimize the SVG code