Html svg中的文本路径在IE中不起作用?
我看到IE显示与firefox、chrome、safari不同Html svg中的文本路径在IE中不起作用?,html,css,svg,Html,Css,Svg,我看到IE显示与firefox、chrome、safari不同 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="700" width="1300"> <defs> <path id="defsPath0" transform="translate(0, 0)" d="M-25,12 L75,12 M-25,32 L75,32
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="700" width="1300">
<defs>
<path id="defsPath0" transform="translate(0, 0)" d="M-25,12 L75,12 M-25,32 L75,32 M-25,52 L75,52 M-25,72 L75,72" />
<path id="defsPath1" transform="translate(0, 20)" d="M-25,12 L75,12 M-25,32 L75,32 M-25,52 L75,52 M-25,72 L75,72" />
<path id="defsPath2" transform="translate(0, 40)" d="M-25,12 L75,12 M-25,32 L75,32 M-25,52 L75,52 M-25,72 L75,72" />
<path id="defsPath3" transform="translate(0, 60)" d="M-25,12 L75,12 M-25,32 L75,32 M-25,52 L75,52 M-25,72 L75,72" />
</defs>
<g>
<text x="0" y="0" font-family="MS UI Gothic" font-size="15" style="" fill="rgb(0, 0, 0)" fill-rule="nonzero" transform="matrix(1,0,0,1,200,20)">
<textPath id="textPath_0_0" xlink:href="#defsPath0">1</textPath>
<textPath id="textPath_0_1" xlink:href="#defsPath1">2</textPath>
<textPath id="textPath_0_2" xlink:href="#defsPath2">3</textPath>
<textPath id="textPath_0_3" xlink:href="#defsPath3">4</textPath>
</text>
</g>
1.
2.
3.
4.
使用Firefox、chrome:1
2
3
4 但是IE:
1
234 请帮帮我!非常感谢你 我使用javascript制作svg 那么,您也应该向我们展示您的Javascript 然而,我怀疑我知道问题出在哪里。我猜您正在使用
createElement()
创建SVG元素。您需要使用createElementNS()
:
在IE11中为我工作。您测试的是哪个版本的IE?如何在IE中获得SVG?SVG独立/HTML内联SVG/HTML外部SVG@altocumulus,我使用IE11,但IE不起作用!@Pavel Gatnar我使用javascript制作svg@TanND如果您使用
ctrl+u
,您的SVG
代码中到底有什么?(它正在使用IE9仿真的JSFIDLE上工作,顺便说一句)非常感谢@Paul LeBeau,我使用document.createElements(“,”textPath”);我修复了它1
document.createElementNS(""http://www.w3.org/2000/svg", "textPath");