Kevin Powell - CommunityKP-C
Kevin Powell - Community15mo ago
38 replies
snxxwyy

svg sizing

Hey, just a couple questions about how sizing of an svg works-

1) If there's no viewbox and you try to resize an svg in css, the content within the svg won't scale with it, why is this? (example in codepen)

2) If you have an svg with a viewbox of 0 0 100 100 and let's say there's a circle in there that has a r, cx and cy of 50 to center it within the viewbox, if you resize the svg with css, what makes the content scale up/down since the svg is now larger/smaller than the viewbox, i'd expect the content to be cut off?

I'd appreciate any help, thanks in advance.
https://codepen.io/deerCabin/pen/RwXEare
Was this page helpful?