Is it possible to use a background image on the stroke of an SVG element?

后端 未结 2 1387
北荒
北荒 2021-01-03 06:06

Just as the question asks - I\'m trying to figure out whether or not it\'s possible to use some kind of pattern or repeated background image for the stroke of an SVG path.

2条回答
  •  攒了一身酷
    2021-01-03 06:32

    You can use the property stroke-dasharray for "patterns" in the stroke:

    
    

    With this you can specify the length of strokes and gaps between. For some examples have a look at the MDN example page.

提交回复
热议问题