So I just recently got into SVG and I'm having a couple problems related to the fact that instead of being resized to fit the container, my SVG image gets cropped out instead.
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Eye</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="js/snap.svg.js"></script>
<script src="js/eye.js"></script>
</head>
<body>
<svg id="svg"></svg>
</body>
</html>
JS:
window.onload = function() {
var s = Snap("#svg");
var circle = s.circle(90,120,80);
var square = s.rect(210,40,160,160);
var ellipse = s.ellipse(460,120,50,80);
}
Now, with that CSS code it surely isn't cropped anymore since the user agent stylesheet on Google Chrome contains "overflow:hidden" regarding SVGs. But is that really the right way to resolve the matter? Also, why does it get cropped instead of scaled? Should I "draw" my svgs using percentages instead of pixels?