You can nest SVG elements

1 min read

This post is part of my Today I learned series in which I share all my learnings regarding web development.

Recently I heard in a podcast that nesting SVGs is valid. ๐Ÿ˜ฒ

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- some SVG content -->
    <svg>
        <!-- some inner SVG content -->
    </svg>
<svg>

I was surprised and started googling. I found two fantastic posts by Sara Soueidan.

So this learning includes "only" two bookmarks for myself. Honestly, read and bookmark them, too. The articles Sara writes are always excellent.

Topics