I have an SVG in an absolutely positioned div. The div is a grid and has a width and height set.
The SVG has a width and height of 100% and has overflow set to visible.
if (for example) the parent div is 150 x 75, I would expect the svg to be 150 x 75, and in Chrome this is indeed the case
However in firefox it is not (not sure about safari?!), it seems to make the height the default for svgs (i believe svgs are naturally 300x150 if no dimensions given)
<html>
<head>
<style>
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
svg {
background-color: green;
height: 100%;
width: 100%;
overflow: visible;
}
#parent{
position: absolute;
left: 30px;
top: 50px;
width: 150px;
height: 75px;
display: grid;
}
</style>
</head>
<body>
<div id="parent">
<svg></svg>
</div>
</body>
</html>