svg,路径标记在Firefox上不起作用 [英] svg, path tag does not work on firefox

查看:195
本文介绍了svg,路径标记在Firefox上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用svg路径标记
淹没一张简单的地图,但它不适用于fire fox或IE
(绘图本身不出现)

听到的是他们的样本

 < svg xmlns =http://www.w3。 org / 2000 / svgversion =1.1> 
;
< / svg>


解决方案

您不应该对 d 属性,请使用空格。另外 stroke-width 必须是一个长度(例如 px )。
这应该工作:

 < svg xmlns =http://www.w3.org/2000/ svgversion =1.1> 
<路径id =lineABd =M450.59 294.28l3.64-0.29l5.97 8.44l-5.54 4.18l-4.01-1.03l-5.39 0.07l-0.87 3.16l-4.52 0.22l -1.24-1.69l1.6-5.14L450.59 294.28L450.59 294.28zstroke =bluestroke-width =3pxfill =blueonclick =alert('Hello')/>
< / svg>

请参阅 spec ,以获得更长和更准确的解释:)。

I am working on a simple map drowning with svg path tag But it dose not work on fire fox or IE (the drawing itself does not appear)

hear is a sample of them

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path id="lineAB" d= "M450.59,294.28l3.64-0.29l5.97,8.44l-5.54,4.18l-4.01-1.03l-5.39,0.07l-0.87,3.16l-4.52,0.22l-1.24-1.69l1.6-5.14L450.59,294.28L450.59,294.28z" stroke="blue" stroke-width="3" fill="blue" onclick="alert('Hello')"/>
</svg>

解决方案

You shouldn't be using commas for the d attribute, use spaces instead. Also stroke-width has to be a length (e.g. px). This should work:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path id="lineAB" d= "M450.59 294.28l3.64-0.29l5.97 8.44l-5.54 4.18l-4.01-1.03l-5.39 0.07l-0.87 3.16l-4.52 0.22l-1.24-1.69l1.6-5.14L450.59 294.28L450.59 294.28z" stroke="blue" stroke-width="3px" fill="blue" onclick="alert('Hello')"/>
</svg>

See the spec for a longer and more accurate explanation :).

这篇关于svg,路径标记在Firefox上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆