iframe height problem

jlknauff

New member
Aug 25, 2008
237
1
0
I must be f*ing retarded today...I'm trying to set the height of an iframe to a percentage. I've tried everything I can think of, but it just displays at about 200px high.

WTF?

HTML:
<iframe src ="http://www.msn.com/" width="100%" height="80%"></iframe>
 


Don't think you can use % for iframe height, if you want the height to automatically match the content Google "jquery iframe auto height". Doesn't work if the page being iframed is on a different domain though.

Sean
 
Without access to the remote page, not many choices. I've read there is a workaround to the auto height security issue where you iframe the remote iframe, not sure if that works. Worse case if you really need this you could setup something like a PHP proxy to serve the remote HTML files locally.

Sean
 
Try this:
HTML:
<iframe src ="http://www.msn.com/" style="width:100%;height:100%"></iframe>

But be warned about percentage it's usually relative either to browser window or parent element (depends).
 
I must be f*ing retarded today...I'm trying to set the height of an iframe to a percentage. I've tried everything I can think of, but it just displays at about 200px high.

WTF?

HTML:
<iframe src ="http://www.msn.com/" width="100%" height="80%"></iframe>

html,body{
height: 100%;
}