如何将 HTML 文件加载到画布中?
javascriptweb developmentfront end scripts
为此,您可以使用 SVG <foreignObject> 元素。让我们看一个例子:
<svg xmlns = "http://www.w3.org/2000/svg"> <foreignObject x = "0" y = "0" height = "500" width = "500"> <body xmlns = "http://www.w3.org/1999/xhtml"> <p>DEMO</p> <input type = "date"/> </body> </foreignObject> </svg>