![](/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.