Fill SVG path element with a background-image

后端 未结 1 651
遥遥无期
遥遥无期 2020-11-22 01:22

Is it possible to set a background-image for an SVG element?

For instance, if I set the element class=\"wall\", t

1条回答
  •  旧时难觅i
    2020-11-22 01:34

    You can do it by making the background into a pattern:

    
      
        
      
    
    

    Adjust the width and height according to your image, then reference it from the path like this:

    
    

    Working example

    0 讨论(0)
提交回复
热议问题