我有以下代码:
<iframe src="http://www.externalsite.com/" style=""/>
假设 www.externalsite.com 的总高度为 X 像素。 X 对我来说是未知的。如何使用 CSS 或其他方法而不是 JavaScript 将 iframe 的高度设置为 X 像素?
最佳答案
试试下面的代码
<body style="margin:0px;padding:0px;overflow:hidden">
<iframe src="http://www.youraddress.com" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe>
</body>
关于html - 设置 <iframe >'s height to maximum document' s 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12016511/