看起来好像没有绘制svg路径,如果它的y点只是0(例如直线水平线)。
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -150 1200 300" width="1200" height="300">
<defs><linearGradient id="line">
<stop offset="0%" stop-color="#fcb404"></stop>
<stop offset="6.25%" stop-color="#fcb404"></stop>
<stop offset="18.75%" stop-color="#fcb404"></stop>
<stop offset="31.25%" stop-color="#fcb404"></stop>
<stop offset="43.75%" stop-color="#fcb404"></stop>
<stop offset="56.25%" stop-color="#fcb404"></stop>
<stop offset="68.75%" stop-color="#fcb404"></stop>
<stop offset="81.25%" stop-color="#fcb404"></stop>
<stop offset="93.75%" stop-color="#fcb404"></stop>
<stop offset="1" stop-color="#1c83d4"></stop>
</linearGradient></defs>
<path d="M0 -52 l75 0 l150 0 l150 0 l150 1 l150 0 l150 0 l150 0 l150 0 l75 0" stroke="url(#line)" fill="none" stroke-width="2px"></path>
</svg>
它必须是“一条路径(通常它不是一条直线)。 有没有人经历过同样的事情,也许知道这种行为来自何处 - 以及如何解决“隐形”问题?
非常感谢!