I'm playing around with an iframe that embeds a second page and just displays a short header above the iframe.
In one test setup, height="100%"
worked correctly and in another setup it didn't and then I noticed that the difference was the the one document where the iframe height always was set to about 150px was an XHTML document, and the document where it works doesn't have a DOCTYPE set.
So, this works: (height fully scaled to window)
<html>
<head> </head>
<body>
<h1>Wrapper Header ...</h1>
<hr/>
<iframe src="/jenkins" width="100%" height="100%">
<p>iframes not suppoerted</p>
</iframe>
</body>
</html>
and this doesn't (height about 150px or so)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head> </head>
<body>
<h1>Wrapper Header ...</h1>
<hr/>
<iframe src="/jenkins" width="100%" height="100%">
<p>iframes not suppoerted</p>
</iframe>
</body>
</html>
Display is the same in IE8 and FF5.
Why is it that the height percentage no longer works if I have XHTML doctype?