the iframe goes 100% height in IE, but not in firefox
how can I do this in firefox?
| SitePoint Sponsor |
the iframe goes 100% height in IE, but not in firefox
how can I do this in firefox?
Hi,
This works fine for me
HTML Code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <title>iframe example</title> <style type="text/css"> html, body, div, iframe { margin:0; padding:0; height:100%; } iframe { display:block; width:100%; border:none; } </style> </head> <body> <div> <iframe src="http://example.org/"> <p><a href="http://example.org/">example.org</a></p> </iframe> </div> </body> </html>
Simon Pieters
in FireFox the iframe is the correct width[500px], however the 100% height does not go 100% but has a scroll bar.... what is wrong?


Nothing is wrong that is how a 100% <iframe> should be displayed FF gets it right.
};-) http://www.xhtmlcoder.com/
Thinking Web: Voices of the Community
> March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?
i did not set the html { } in CSS, works now .. thanks!!! [it was my mistake]
Originally Posted by zcorpan
I tried the above code for making the Iframe into 100% height.....But it doesnot work for me....Here is my actual code....If there is any thing wrong in it please tell me and help me to make and <iframe height into 100%.
Thanks
Here is my code.....
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>iframe example</title>
<style type="text/css">
html, body, div, iframe { margin:0; padding:0; height:100%; }
iframe { display:block; width:100%; border:none;height:100%; }
</style>
</head>
<body>
<div>
<iframe name="I3" src="http://www.mlsb.com/mls/featured.cfm?cid=8058" marginwidth="0" marginheight="0" vspace="0" hspace="0" frameborder="1" width="100%" height="100%" scrolling="no"></iframe>
</div>
</body>
</html>
Thanks
you can set iframe to 100 height if you put this in your head section
<style type="text/css">
html,body{
width:100%;
height:100%;
margin:0px;
padding:0px;
}
</style>

Hi,
I am having a similar problem with Iframe height in Firefox.
The content length of my Iframe is about 55000.And I have set the Height of Iframe as 60000.But the Iframe displays contents only till around 33000(px) and shows a scrollbar.Leaving the extra space as blank.It somehow does not use the whole space , and always limits itself to 33000.Is this a problem with Firefox???
Thanks for your help,
SharathChandra.
To make the iframe stretch 100% height, just make sure all the divs surrounding the iframe are set to height: 100% in the css aswell. That includes body and html.
Bookmarks