When you use an iframe on a page, generally speaking, you don't want the iframe to display ugly scroll bars, so that the content in the iframe and the content of the main page are integrated. At this time you will set the scrolling="no" attribute. But in this way, if the content in the iframe changes and the height changes with the change of the content, your iframe will appear too long, resulting in a large blank space underneath, or on the contrary, the height of the iframe will be too small. Some content will be blocked. Here I provide a javascript script compatible with IE/NS/Firefox to dynamically adjust the height of the iframe. If you need to adjust the width, the principle is the same and will not be detailed in this article.
First, your main page must contain the following javascript code:
Then add code where iframe is used on the main page: