Is it possible to set background-image
for an SVG <path>
element?
For example, if I set the element class="wall"
, the CSS style .wall {fill: red;}
works, but .wall{background-image : url(wall.jpg)}
is not available, nor is .wall {background-color: red;}
.
P粉9981006482024-01-29 00:10:37
You can do this by setting the background to a pattern:
Adjust the width and height according to your image and then reference it from the path like this: