I want to change the color of each polygon of the svg on hover using css.
This is the hmtl code:
<svg class="compass-svg" width="200" height="200">
<polygon id="N" points="100,10 125,50 100,100 75,50" style="fill:#fff; stroke:#000; stroke-width: 1;"/>
<polygon id="NE" points="155,45 150,75 100,100 125,50" style="fill:#fff; stroke:#000; stroke-width: 1;"/>
</svg>
When I hover one of the polygons, its filling should turn to #000.
I've already tried to change to color using the id:
/*This does not work*/
#N:hover {
fill: #000;
}
I found this solution using jquery, but I wonder if this can be achieved using pure css: my svg polygons fills are not changing color on hover