Svg, path tag not working on firefox

I am working on a simple topography with the svg path tag. But the dose does not work for the 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> 
+4
source share
1 answer

You should not use commas for the d attribute, use spaces instead. Also stroke-width should 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 specification for a longer and more accurate explanation :).

+6
source

Source: https://habr.com/ru/post/1437034/


All Articles