Just a few days back, I was handed an SVG file by some designers and my task is to integrate it with some color variations and the usual hover effects, /edit: but at this point, the most important thing is to have control over the background color /edit/.
Here's a snippet of the HTML:
<div>
<svg class="drawelements" viewBox="50 200 550 360">
<polygon fill="red" points="312.200 265.600, 312.200 332.300, 265.600 332.300, 265.600 265.600, 312.200 265.600, 312.700 265.100, 265.100 265.100, 265.100 332.800, 312.700 332.800, 312.700 265.100, 312.700 265.100"></polygon>
<path class="st0" d="M369 265.6v66.7h-46.6v-66.7H369M369.5 265.1h-47.6v67.7h47.6V265.1L369.5 265.1z"></path>
<path class="st0" d="M425.7 265.6v66.7h-46.6v-66.7H425.7M426.2 265.1h-47.6v67.7h47.6V265.1L426.2 265.1z"></path>
<path class="st0" d="M480.6 265.6v66.7H434v-66.7H480.6M481.1 265.1h-47.6v67.7h47.6V265.1L481.1 265.1z"></path>
You can see how it appears in this fiddle: fiddle
I decided to experiment with a polygon element first to eliminate potential issues with path elements.
Despite trying traditional CSS styling methods and inline styles within each element, nothing seems to work. Could it be that I need to use something other than background-color or fill?
If you check out the fiddle, please disregard the viewBox as the actual SVG has many more components which I omitted for simplicity in this post.