Home >Web Front-end >HTML Tutorial >About the custom height of iframe_html/css_WEB-ITnose
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
You can call js in the iframe page to calculate the height and width of the iframe content, and then call the js of the parent window from the js of the iframe page to set the width and height of the iframe element.
I tried the code on the second floor, but it still doesn’t seem to work. It doesn’t work in Firefox and Google, but I still appreciate everyone’s help