gpt4 book ai didi

html - 设置 <iframe >'s height to maximum document' s 高度

转载 作者:太空宇宙 更新时间:2023-11-04 15:42:13 24 4
gpt4 key购买 nike

我有以下代码:

<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 - 设置 &lt;iframe >'s height to maximum document' s 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12016511/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com