I have an SVG constrained to 30% inside a flexbox:
<body style="height: 100vh;">
<div style="display: flex; flex-direction: column; height: 100%;">
<svg style="flex-basis: 30%" width="100%" height="100%" viewBox="0 0 100 100">
<ellipse cx="50" cy="50" rx="50" ry="50"></ellipse>
</svg>
<div style="flex-basis: 70%; background-color: orange;">
flex-basis: 70%
</div>
</div>
</body>
But when I put that SVG inside a div constrained to 30% the SVG takes all the space:
<body style="height: 100vh;">
<div style="display: flex; flex-direction: column; height: 100%;">
<div style="flex-basis: 30%;">
<svg width="100%" height="100%" viewBox="0 0 100 100">
<ellipse cx="50" cy="50" rx="50" ry="50"></ellipse>
</svg>
</div>
<div style="flex-basis: 70%; background-color: orange;">
flex-basis: 70%
</div>
</div>
</body>
How can I constrain the SVG to the parent div
's height in the second example?
(I've tried setting style="height: 100%"
on the SVG in the second example as a shot in the dark but without success.)