考虑一下an SVG image with text个.有没有可能使用image
标签(或任何其他标签)将其嵌入到一个HTML文档中,并将文本保留为文本,这样就可以 Select 或搜索它,例如使用"Control+Find"?
普通的image
标记不能做到这一点:
<image src="https://www.w3.org/TR/SVG11/images/text/toap04.svg"></image>
考虑一下an SVG image with text个.有没有可能使用image
标签(或任何其他标签)将其嵌入到一个HTML文档中,并将文本保留为文本,这样就可以 Select 或搜索它,例如使用"Control+Find"?
普通的image
标记不能做到这一点:
<image src="https://www.w3.org/TR/SVG11/images/text/toap04.svg"></image>
在嵌入带有可选文本的SVG时,您有几个 Select .
您可以使用<svg>
标签在HTML文档中嵌入内联SVG.
<svg width="453px" height="136px" viewBox="0 0 1000 300">
<defs>
<path id="MyPath" d="M 100 125
C 150 125 250 175 300 175
C 350 175 450 125 500 125
C 550 125 650 175 700 175
C 750 175 850 125 900 125" />
</defs>
<use xlink:href="#MyPath" fill="none" stroke="red" />
<text font-family="Verdana" font-size="60" fill="blue" letter-spacing="2">
<textPath xlink:href="#MyPath">
Choose shame or get war
</textPath>
</text>
<rect x="1" y="1" width="998" height="298" fill="none" stroke="blue" stroke-width="2" />
</svg>
<object>
tag当链接到外部SVG时,也可以使用<object>
标签.
<object data="https://www.w3.org/TR/SVG11/images/text/toap04.svg" width="453" height="136"></object>