Oh well, I understand:
<svg width="100" height="100">
<circle cx="50" cy="50" r="50" fill="red"></circle>
</svg>
This means: width = 100px, not 100% . Ditto for the circle attribute, cx = "50" means X coordinate = 50px, not 50%.
What can you do:
Html
<svg class="scaled-svg">
<circle cx="50%" cy="50%" r="20%" fill="red"></circle>
</svg>
CSS
.scaled-svg {
width: 100%;
height: auto;
}
With this SVG code will be
source
to share