SVG无法在Mozilla Firefox中运行

时间:2013-11-04 11:32:56

标签: html5 firefox svg

我是SVG的新手,这是我的SVG代码:

<div style="width:650px;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect width="640" height="200" style="fill:#ddd;"></rect>
<polyline points="0 200,20 200, 40 200, 60 200, 80 200, 100 200, 120 200, 140 200, 160 200, 180 200, 200 200, 220 200, 240 200, 260 200, 280 200, 300 200, 320 200, 340 200, 360 200, 380 200, 400 200, 420 200, 440 200, 460 101, 480 200, 500 200, 520 2, 540 35, 560 167, 580 167, 600 200, 620 167, 640 200, 640 200" style="fill:blue; stroke:grey; stroke-width:3; opacity:0.4;"></polyline>
</svg></div>

我正在尝试为我的网站制作分析表,并且在此链接上看起来像img http://1zh.us/examples/svg.jpg 这是代码http://1zh.us/examples/svg.html的链接 它在IE和Chrome中工作,但在mozilla Firefox中没有。 我做错了什么???

1 个答案:

答案 0 :(得分:5)

points的{​​{1}}中,逗号位于polylinex值之间,空格将这些点分开。

y

您还需要使SVG元素足够大,以包含<polyline points="0,200 20,200 40,200 60,200 80,200 100,200 120,200 140,200 160,200 180,200 200,200 220,200 240,200 260,200 280,200 300,200 320,200 340,200 360,200 380,200 400,200 420,200 440,200 460,101 480,200 500,200 520,2 540,35 560,167 580,167 600,200 620,167 640,200 640,200" style="fill:blue; stroke:grey; stroke-width:3; opacity:0.4;"> </polyline>

polyline