I play with an iframe that includes a second page and just displays a short title above the iframe.
In one test setting, height="100%" worked correctly, and in another setting it did n’t, and then I noticed that the difference was the only document where iframe height was always set to 150px, it was an XHTML document, and the document in which It works, does not have a DOCTYPE set.
So this works: (the height is fully scaled to the 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 it’s not (height about 150 pixels 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 in IE8 and FF5 is the same.
Why is it that percentage of height no longer works if I have XHTML doctrines?
source share