Hi,
To understand the concept of percentage height in terms of css the first thing you need to know is that you can only base a percentage height on a parent that has a height defined (other than auto or content height). If the parent has no height defined then the child will default to height:auto even if you said height:100%.
If the parent of your element also has a height defined in percentage then the same holds true and it’s parent must also have a height defined. If the parent height is not a fixed height (eg px) but a percentage height then you need an unbroken chain on height:100% all the way back to and including the html element.
Obviously that approach is pretty much unworkable and indeed in your example you were getting only 98% height of each parent so I’ve no idea what the end result would have been. 
The problem with that approach is that you are also limiting all those elements to a fixed percentage height which means that they can in fact never grow and expand with content. 99.9% of the time you do not want to apply a fixed height to content that is going to hold text content anyway.
You could use min-height instead but unfortunately you cannot base a percentage height on a min-height element so you are back to square one.
Luckily the vh
unit was introduced which stands for ‘Viewport Height’ and allows an element to be based on the size of the viewport without needing an unbroken chain of elements back to html with height defined. height:100vh
means take up 100% of the viewport height. height:10vh means take up 10% of the viewport height.
Therefore to answer your question you could set the height of your iframe height:98vh
and get a 98% viewport height. You could then lose all the heights that you had defined.
html,
body {
margin: 0;
}
#wrapper {
width: 100%;
max-width: 40em;
margin: 0 auto;
}
iframe {
display: block;
width: 100%;
height: 80vh; /* use vh units*/
border: none;
}
https://codepen.io/paulobrien/pen/LYGdPNy
However, this opens another can of worms in that your 98vh refers to the viewport height but your iframe is not at the top of the viewport and therefore will extend below the fold because you have content above the iframe taking up viewport space. You need to think carefully about the use that you want from your iframe in relation to the content that surrounds it.
The second problem with your approach is that generally iframes have an aspect ratio like images and simply setting a height and a fluid width will mean the iframe no longer maintains its aspect ratio. This may be OK where the iframe is holding content but if the iframe is a video then that approach will be bad and a proper aspect ratio approach would be needed. However, as you did not specify what the iframe content was I will leave that as a question for another day.