Hello!
How to set the background color of a png with transparent areas and inserted into the svg as an image element?
Neither background-color nor fill do not work:
image { fill: black; background-color: black; } rect { fill: green; }
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="0" y="0" width="400" height="300"></rect> <image xlink:href="https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png" x="0" y="0" height="400px" width="300px" /> </svg>
https://fiddle.jshell.net/6j2dLej5/
thank