The exact same code works under Windows with Chrome, FF and IE. I just switched to Linux and this code doesn't work neither on FF or Chrome? I tried the "style" tag, with no change in results. Can someone help? Is there a browser independent way of having 100% svg coverage?
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script src="jquery-1.11.2.min.js"></script>
<script src="snap.svg-min.js"></script>
<svg id="svgEle" height="100%" width="100%"></svg>
<script>
var snapCanvas = Snap("#svgEle");
var circle = snapCanvas.circle(100, 100, 100);
</script>
</body>
</html>
The browser is behaving correctly. If you try the HTML on Windows Chrome you get the same result.
The reason is as follows:
<body>
).<body>
by default has width 100% and its height collapses to the height of its children.<body>
height defaults to the "intrinsic size" used by browsers when it can't determine a size. That height is 150px.