为什么我写path路径 不生效没有样式?

引用文字

代码如下
https://www.w3cplus.com/svg/s...

<path d="M0 0" stroke="black" />
<path d="M0 0 H50" stroke="black" />
<path d="M0 0 V50" stroke="black"/>
<path d="M0 0 L50 50" stroke="black"/>

写这些显示不出来,文档说明的效果,求帮忙,谢谢

阅读 2.7k
2 个回答

你试试

<svg width="100px" height="100px" viewBox="0 0 100 100"> 
    <path d="M0 0 L50 50" stroke="black"></path>
</svg>

指定一下stroke-width试试

推荐问题