SVG filter is not working properly for straight li

2019-06-27 00:48发布

This question already has an answer here:

<svg height="210" width="500">
  <defs xmlns="http://www.w3.org/2000/svg">
    <filter id="dropshadow" height="130%">
      <feGaussianBlur in="SourceAlpha" stdDeviation="3" />
      <feOffset dx="2" dy="2" result="offsetblur" />
      <feMerge>
        <feMergeNode/>
        <feMergeNode in="SourceGraphic" />
      </feMerge>
    </filter>
  </defs>
  <line x1="0" y1="100" x2="200" y2="100" style="stroke:rgb(255,100,90);stroke-width:3px" filter="url(#dropshadow)" />
</svg>

I am trying to use shadow in a straight line, but it's hiding the line itself. If I use diagonal line it works properly.

1条回答
混吃等死
2楼-- · 2019-06-27 01:26

Try to replace the part and put style="stroke:rgb(255,0,0);stroke-width:2"

查看更多
登录 后发表回答