+ 2
How to write text inside a <rect> tag in svg in html?
2 ответов
+ 3
🇮🇳Omkar🕉 Thank you very much
+ 1
<!--
Sùjàñ Khârál
*use <text> svg element.
*place both rect and text elements in same parent svg tag.
*refer:https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text
*run code given below.
-->
<svg style="border:1px solid red; height:300; width:300;">
<rect x="40" y="40" height="150" width="150" fill="red"></rect>
<text x="50" y="70" >This is some text</text>
</svg>