Skip to content Skip to sidebar Skip to footer

Iframe Default Height

Why does iframe have a default height of some 100px when the html content inside has only 20px? You can view an example here: http://www.tulumarka.com/galerija/28497/after-beach-pa

Solution 1:

IFrames can't adjust themselves to the height of their content. They always have a static height - possibly some default height, that the browser sets if the author doesn't.

If the content of the iframe is served from the same domain as the "outer" content, then you can use JavaScript to adjust the size.

Solution 2:

I'm not sure in 100% but there in loaded document into iframe I could see that body and div style have height: 100% maybe that's the problem.

But do you really need to use iframes? According to W3C you shouldn't. If you wish to put dynamically some content, why not to use Ajax? You already do that by jQuery script. So just modify it and put content into div, not iframe.

Don't use frames, use Ajax ;)

Post a Comment for "Iframe Default Height"