Is it possible to use an image in place of the stroke of an SVG path?

后端 未结 2 400
心在旅途
心在旅途 2021-01-20 02:05

First off, I know this question is very similar to this question, but I tried implementing that solution with an SVG PATH and it did not w

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-20 02:33

    That's a Chrome/Safari bug you're relying on.

    stroke:url(#pattern);
    

    is actually shorthand for

    stroke:url(#pattern);
    

    but there's no pattern in the css file. Chrome gets this wrong, Firefox gets it right. If you fix the reference Firefox will work but unfortunately Chrome won't any longer. The most compatible solution would therefore be to move your CSS (at least the bit that references the pattern) into the SVG file itself within