svg里面的foreignObject 标签可以嵌入div。
注意格式第一个标签加上xmlns="http://www.w3.org/1999/xhtml"。
下面主要说一下div的可以编辑状态。
首先是第一个属性contenteditable,div可以编辑。
样式-webkit-user-select: text,为了在手机端可以使用。
<meta name="format-detection" content="telephone=no" /> //让手机号不要自动变成链接,手机端用
var textHtml = ` <foreignObject width="${width}" height="${height}"> <div xmlns="http://www.w3.org/1999/xhtml" contenteditable = true style="font-size:${fsize}px; text-align: ${fonta