admin管理员组文章数量:1312849
i have tried some basic examples like text, rect, circle, everything went fine. i just moved to Path
element. I struggle to view the path in the browser. This is the code snippet i used
<svg width="500" height="200">
<path d="M 20 35 L 120 100 Z"> </path>
</svg>
but seems its not working. i have tested chrome and firefox. can someone figure it out in correct way. Thanks in advance. also i just created a fiddle here
i have tried some basic examples like text, rect, circle, everything went fine. i just moved to Path
element. I struggle to view the path in the browser. This is the code snippet i used
<svg width="500" height="200">
<path d="M 20 35 L 120 100 Z"> </path>
</svg>
but seems its not working. i have tested chrome and firefox. can someone figure it out in correct way. Thanks in advance. also i just created a fiddle here
Share Improve this question asked Sep 8, 2016 at 20:37 subashsubash 3,1153 gold badges19 silver badges22 bronze badges 1- The initial value of stroke is none, which means no paint is applied unless you specify a color in some way. – traktor Commented Sep 8, 2016 at 22:32
1 Answer
Reset to default 6Try to add stroke
and stroke-width
attributes for showing the path:
<svg width="500" height="200">
<path stroke="#f00" stroke-width="3" d="M 20 35 L 120 100 Z"> </path>
</svg>
Or add the third point like this:
<svg width="500" height="200">
<text y="20">SVG Test</text>
<path d="M 20 35 L 120 100 L 0 100 Z"> </path>
</svg>
本文标签: javascriptSimple SVG Path not workingStack Overflow
版权声明:本文标题:javascript - Simple SVG Path not working - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741879040a2402637.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论