The direct answer would be to use the poly SVG attribute
That is, you do not rely on CSS to rotate it.
The svg element after drawing is not processed after css changes appearance.
Drawing a diamond shape in poly is your best option to avoid a bounding box.
<svg height="250" width="500"> <polygon points="0,25, 25,0, 50,25, 25,50 " style="fill:black" /> </svg>
Basic example
Jsfiddle
Update:
The code you created shows that you are not editing the SVG background.
If you want the SVG background to change, you can add an attribute like I lined up, not edited in CSS.
For my version of working with the hover event, for example, you will need an identifier for each of the svg elements, and then :hover for each of them or javascript .. but this is just an option. Other answers look more applicable.
My answer only makes drawing easier on SVG.
source share