我将以下内容粘贴到html中:
<svg width="400px" height="300px" viewBox="0 0 400 300" xmlns="http://www.w3.org/2000/svg">
<foreignObject width="100" height="50" requiredExtensions="http://www.w3.org/1999/xhtml">
<body xmlns="http://www.w3.org/1999/xhtml">
<p>Here is a paragraph that requires word wrap</p>
</body>
</foreignObject>
</svg>
但是,它表示为
<svg width="400px" height="300px" viewBox="0 0 400 300" xmlns="http://www.w3.org/2000/svg">
<foreignobject width="100" height="50" requiredextensions="http://www.w3.org/1999/xhtml">
<!-- XHTML content goes here -->
<p>Here is a paragraph that requires word wrap</p>
</foreignobject>
</svg>
在DOM中。为什么要删除body
?
Here body
保留在DOM内。