[英]How to display the text over svg rect in Javascript
I want to display the text over the svg rect. 我想在svg rect上显示文本。 Text is hidden in the sample.
文本隐藏在示例中。 I want full text as visible :
我希望全文可见:
<svg width="400" height="110"> <rect width="300" height="100" style="fill:white;stroke-width:3;stroke:rgb(0,0,0);"/> <text x="10" y="35" fill="red">I love SVG! Text Chart</text> </svg> <svg height="300" width="60" style="position:absolute;left:20px;top:20px"> <rect width="300" height="50" style="fill:yellow;stroke-width:3;stroke:rgb(0,0,0);"/> </svg>
Here is the updated code:- 这是更新的代码:
<svg width="400" height="110"> <rect width="300" height="100" style="fill:white;stroke-width:3;stroke:rgb(0,0,0);"/> </svg> <svg height="300" width="1000" style = "position:absolute;left:20px;top:20px"> <rect width="60" height="60" style="fill:yellow;stroke-width:3;stroke:rgb(0,0,0);"/> <text x="10" y="35" fill="red">I love SVG! Text Chart</text> </svg>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.