<figure><object data="~/Upload/XXXX.svg" type="image/svg+xml"></object></figure>
Your CSS expects to find Figure -> Object -> SVG elements, in the strict hierarchy. But all it finds is Figure -> Object and no SVG element. Not sure, but try using:
figure object {
fill: red;
}
Your HTML document does not contain an
SVG
child in the
object
element for
figure
element; thus the style is not applied.
fill | CSS-Tricks[
^]
Also, you can directly use your SVG media in an HTML
image
tag; unless you have strict reasons to prefer the
figure
element.