If I have this SVG:
<body>
<svg xmlns="http://www.w3.org/2000/svg">
<text x="10" y="50" font-size="30" class="svgClass2" id="svgText2">My SVG</text>
</svg>
</body>
IIUC If I want to embed that SVG markup to a data URI then I would convert that SVG markup to base64 and set it as the source of an image tag?
<img src="data:image/svg+xml,charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmN==" />
Is the value PD94bWwgdmVyc2lvbj0iMS4wIiBlbmN...
this:
<svg xmlns="http://www.w3.org/2000/svg">
<text x="10" y="50" font-size="30" class="svgClass2" id="svgText2">My SVG</text>
</svg>
Is that correct?
Additional Questions if possible:
Is it still interactive as an img?
Do classes still apply?
Does the ID still apply?
Is it smaller in size as data URI base64?
Note: There is a specific use case where this will be used. I am aware of some of the pros and cons.
References:
https://stackoverflow.com/a/882783/441016 - Data URI in image tag
https://vecta.io/blog/best-way-to-embed-svg - this does not show examples but the comments people talk about data URI