I'm trying to manipulate svg images with css and I have not really had the slightest success, I guess it's some detail I'm not doing since on the internet there are many examples of this that I'm trying and I guess it's because it works for them all, but I could not even place the svg in the html directly, or through an img tag, or with the css in the html or the svg both internally and externally, I really could not, if someone knows how to do it thank you. Then I leave my code:
vector.html
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Vector</title>
<style type="text/css">
*
{
margin: 0px;
padding: 0px;
}
html, body
{
height: 100%;
}
body
{
background-color: red;
}
</style>
</head>
<body>
<img src="img/drawing.svg" alt="svg">
</body>
</html>
drawing.svg - The file was created with inkscape, I just want to change the color of the painting, for now, but I have not even been able to do that. The attribute class="cuadrado"
I manually place, and as you can set in the second line of the code, I'm inserting the css in the svg image externally.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/css" href="epa.css"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="svg2"
viewBox="0 0 744.09448819 1052.3622047"
height="297mm"
width="210mm">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1">
<rect
y="233.69289"
x="102.70579"
height="270.90512"
width="315.55981"
id="rect3336"
style="fill:#00ff00;fill-opacity:1"
class="cuadrado"/>
</g>
</svg>
epa.css - This file is in the same folder as the svg image, and as you can see it is very very basic.
#rect3336
{
fill: blue;
fill-opacity:1;
}
The file "svg" and the file "css" are in a folder called "img", the file "vector.html" is in the main folder, that is, "img" is a subfolder. I hope you help me.