Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h2>Three rectangles that change color</h2> <svg width="500" height="300"> <rect x="10" y="20" width="90" height="60"> <animate id="a1" attributeName="fill" from="red" to="blue" dur="3s" fill="freeze" /> </rect> <rect x="10" y="120" width="90" height="60"> <animate id="a2" attributeName="fill" from="blue" to="yellow" begin="a1.end" dur="3s" fill="freeze" /> </rect> <rect x="10" y="220" width="90" height="60"> <animate id="a3" attributeName="fill" from="yellow" to="green" begin="a2.end" dur="3s" fill="freeze" /> </rect> Sorry, your browser does not support inline SVG. </svg> <p><strong>Note:</strong> This example does not work in Firefox.</p> </body> </html>