This works:
<img src="img/home/icon.svg" alt="one" class="trysvg">
This doesn't work:
<svg>
<use xlink:href="img/home/icon.svg" class="trysvg"></use>
</svg>
CSS:
.trysvg {
//position: relative;
//display: block;
//color:black;
height: 20rem;
width: 20rem;
}
When checking dev tools and trying it with use svg it shows shadow-root (closed). Tried to search, but couldn't come up with any solution. SVG icon is from reliable source - downloaded, so there shouldn't be a problem with svg code. Any ideas?
edit: I also tried to put class on the < svg class... >, was still not working and also put class on < svg class... > + < use class.. > and still nothing.
edit2: when I use href instead of xlink href the problem remains..