-1

I am trying to add a inside SVG text thus:

<text id="m1Caption" x="65px" y="40px">mass m1=<div id="m1" class="CTATTextArea"></div>kg</text>

I intend to create the div within the text so that the div appears inline. However, the div shows up elsewhere. I have tried position: inline in the css but it doesn't work. Any thoughts? Thanks in advance.

2 Answers2

0

You can't append HTML to SVG (technically you can with foreignObject, but it's a rabbit hole). Furthermore, visible elements in SVG can't be nested, so elements such as circle, rect, path and such can't have children elements.

randomUser
  • 37
  • 1
  • 3
-2

You can't add a div tag inside SVG. But if you want to add a text inside SVG you can try making that SVG in FIGMA.

While exporting export as SVG and include id attributes to perform animations if you want.

https://www.figma.com/