In my website's design, I have a div structure with an iframe to load pages.
The header remains at the top seamlessly
The footer stays at the bottom perfectly
The content is positioned in the middle flawlessly
However, the iframe does not stretch to fill the entire height of its container.
I did not specify a pixel height in the style
When I added this CSS:
iframe {
margin:0;
padding:0;
min-height:72%;
width:100%;
background-color:#ddd;
}
HTML
<div id="container">
<div id="header"> blah blah </div>
<div id="content">
<div id="menu"> some code for the menu </div>
<div id="iframeDiv" class="contentdiv">
<iframe src="#" id="#" width="100%"></iframe>
</div>
</div>
<div id="footer">blah blah</div>
</div>
CSS
html, body {
margin:0; padding:0; height:100%; width:100%;
}
iframe {
margin:0; padding:0; height:72%; width:100%;
}
#container {
min-height:100%; position:relative; width:100%;
}
#content {
padding:10px; padding-bottom:30px;
}
I attempted to add styles for #iframeDiv but no luck!
It extended down to the footer, but only in Chrome. Internet Explorer didn't display the background color either. Firefox showed the background color but did not stretch to 72%. How can I make the iframe height stretch to 72% consistently across all browsers?