CSS:iframe 不显示 100% 高度...更像是 100px 高度

标签 css iframe height width overflow

此页面 ( http://purcraft.com/madeinla/) 有问题,我正在尝试使用 iframe 元素显示此页面的内容:( http://purcraft.com/madeinla/home2_height.html)。

宽度不错,但高度呢?似乎更像是 100px 而不是我想要的 100%。为什么是这样?这是我的代码。这非常简单。

<iframe style="overflow:hidden;height:100%;width:100%" height="100%" width="100%" src="http://purcraft.com/madeinla/home2_height.html"></iframe>

最佳答案

像这样尝试:

position: absolute;和 border:none; 到您的 IFRAME 以及 height:100% 以获得预期的结果。

HTML:

<iframe width="100%" height="100%" src="http://purcraft.com/madeinla/home2_height.html" style="position: absolute; height: 100%; border: none"></iframe>

关于CSS:iframe 不显示 100% 高度...更像是 100px 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29641823/

相关文章:

css - 如何更改 SASS 的 CSS 输出格式样式

javascript - 子域上的 iframe 是否提供足够的 JS 沙箱?

javascript - 通过 iframe 的外部 POST 表单

android - 无法在样式中设置资源形状的高度和宽度

flutter - 如何让 child 在 flutter 中连续适应高度?

jquery - Bootstrap/CSS 始终使内容完美居中于页面

javascript - 每次单击 li 的一部分时,href 都不会加载链接。使用javascript使整个li可点击

javascript - 如何使用 intro.js 突出显示 Bootstrap 模式

javascript - 专家的 iframe url 问题

css 相等的 div 高度