Skip to main content
100%

Fork of SVG Animations using CSS transitions

✓ Published0🌍 Public
Wwasti
Last edited Jan 22, 2023
Created on Jan 22, 2023

A single red SVG rectangle transitions its fill color and stroke width over three seconds when hovered. The example demonstrates CSS transitions applied directly to SVG elements via the `transition` property, with the `rect:hover` pseudo-class triggering the change. This static, inline HTML file uses no external JavaScript libraries, relying purely on CSS present in the style block. The rectangle starts with a thick black stroke and red fill, then shifts to green with a much thicker stroke on mouseover.

AI-generated description

Inspired by w3schools

MIT Licensed

Similar vizzes