I have been puzzling over this bit of HTML/CSS for hours and I can't figure out where I'm going wrong. It is part of a more complicated layout, but I think I have isolated the problem.
This is my HTML:
<div class = "outer">
<div class = "middle">
<div class = "inner">
<svg viewbox = "0, 0, 250, 250">
...and this is my CSS:
height: calc(100% - 190px);
width: calc(100% - 20px);
height: calc(100% - 20px);
margin: calc(10px + 0%);
height: calc(100% - 10px - 2.5rem);
If you remove the SVG, the divs and table behave as I would like - on window resize, the table doesn't exceed the size of the page, and the divs all scale accordingly.
When you include the svg, what I would expect (and what I would want) is for the svg to scale to fit the .inner div, but not to exceed it or alter the flow of the layout in any way.
This is not what happens.
I've checked this in Safari and in Firefox, and both give me unexpected but different results. In firefox, if the window shrinks beyond a certain point, the svg height expands and the whole window ends up scrolling.
In Safari, the svg height scales as the width changes, but the width doesn't scale as the height changes.
This seems like a pretty simple thing and I don't really know where I'm going wrong. I am sure it is an obvious rookie error of some sort. I have tried every combination of max/min height/width on the svg.
Thanks for your help!
EDIT: If I get rid of the table (remove the table, td, tr) everything works as expected. Equally, if I get rid of the svg and keep the table, everything works as expected.