Reputation: 1106
I have specified dashArray property as 0,0 for svg element(path). But when I run this in Chrome and Internet Explorer, the output differs.
<svg height="80" width="300">
<g fill="none" stroke="black" stroke-width="4">
<path stroke-dasharray="0,0" d="M5 20 l215 0" />
<path stroke-dasharray="5,2" d="M5 40 l215 0" />
</g>
</svg>
Screenshot for Chrome browser:
Screenshot for Internet Explorer:
So,I would like to know which one is the correct output and how to achieve the correct output in other browser. Kindly, suggest me your ideas to get rid of this issue.
Thanks, Dharani.
Upvotes: 1
Views: 107
Reputation: 123995
The SVG spec is ambiguous on the matter but the spec authors clarified that Chrome is right. Not sure whether the spec has been updated yet. Firefox renders the line too (after some debate on the matter that you can read in the linked bug).
If you want to render a solid line on all browsers, remove the stroke-dasharray property altogether, or set the dash length to something > 0.
Upvotes: 1