【发布时间】:2019-03-19 05:50:14
【问题描述】:
我正在尝试自动换行,因为我不会提前知道文本是什么。
我尝试使用this 问题中接受的答案,但没有任何显示。到目前为止,这是我的示例代码:
<svg id="viz" style="margin:auto; position:fixed; height:100%; width:100%;" xmlns="http://www.w3.org/2000/svg">
<switch>
<g requiredFeatures="http://www.w3.org/Graphics/SVG/feature/1.2/#TextFlow">
<textArea width="200" height="300">whatever</textArea>
</g>
<foreignObject width="200" height="300">
<textArea xmlns="http://www.w3.org/1999/xhtml" style="width: 200px;height: 300px">otherwise</textArea>
</foreignObject>
</switch>
</svg>
我在 FireFox 中渲染这个 SVG(因为它是网页的一部分)。
【问题讨论】:
标签: svg