How to embed animated SVG

Learn how you can use SVG animations on a web page

This page provides information intended for web developers.

Adding an SVG animation on your web page is as simple as adding a video or an image. This is done using an <object> tag, which defines a container for our SVG animation to be embedded as an external resource.

<object data="/path/to/animation.svg"
        type="image/svg+xml"
        width="1920"
        height="1080"
></object>

That's it! That's all it takes. Once embedded on your webpage, you are free to apply various CSS styles to the tag, just like you would with an ordinary <img> tag.

Last updated