I'm trying to add a SVG to an HTML page with the <use>
tag as following:
<div id="ampoule_container">
<svg>
<use href="resources/assets/Ampoule.svg#ampoule"/>
</svg>
</div>
The problem is that it appears completely black, and a part of it is missing like so:
It should look like this:
If I type its path in a navigator it shows up correctly. After checking, no CSS is influencing its color.
My guess is that <use>
tag doesn't support colors, but only shapes, what can I do ?
Here is the SVG code made with Adobe Illustrator:
<?xml version="1.0" encoding="UTF-8"?>
<svg id="ampoule" data-name="ampoule" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 180 500">
<defs>
<style...>
<clippath id="clippath-4">...</clippath>
<linearGradient.../>
<linearGradient.../>
</defs>
<g class="cls-10">
<g id=...>...</g>
<g id=...>...</g>
<g id=...>...</g>
<g id=...>...</g>
</g>
</svg>