Home >Web Front-end >HTML Tutorial >About the custom height of iframe_html/css_WEB-ITnose

About the custom height of iframe_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:18:341036browse

Recently I encountered such a problem at work, which really troubled me. Regarding the problem of customizing the height of iframe, it is like this. I use iframe to embed a JSP page in HTML. The content of the jsp page is imported from the background. Taken out, because the taken out content is sometimes a lot and sometimes very little, so setting the height of the iframe becomes a very troublesome problem. If the setting is too small, the content with a lot of content will not be fully displayed. If the setting is too much, the height of the iframe with a small content will be far away. It leaves a big empty space at the bottom, which is not nice to look at. Take a look at the code I wrote




In this code onload="this.height=window.frames['cjrd'].window. document.body.scrollHeight" is to get the adaptive height, which is normal in IE and 360 browsers, but in Firefox and Google, it cannot get the adaptive height. Please help.


Reply to discussion (solution)