![](/img/trans.png)
[英]How to change the height and width of svg <text>,if it is greater than the height and width of svg <rect> in javascript?
[英]How to display the text over svg rect in Javascript
我想在svg rect上显示文本。 文本隐藏在示例中。 我希望全文可见:
<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>
这是更新的代码:
<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.