【发布时间】:2019-02-09 20:27:05
【问题描述】:
我正在尝试为标题增加此 iframe 的高度,以便不显示滚动条。我在这里错过了什么?
来自 index.html:
<header>
<iframe src="header.html" frameborder="0" width="100%" height="270"></iframe>
</header>
来自 header.html:
<header>
<div style="display: flex; justify-content: center;">
<a href="index.html" target="_parent"><img src="images/$RK6ZV6D.JPG" alt="logo" width="60%"></a></div>
来自 main.css:
iframe {
overflow: auto;
height: auto;
}
header {
background-color: #fff;
}
【问题讨论】:
-
你到底想在这里实现什么?
-
我试图增加 iframe 的高度,以便显示图像的底部。
-
好的。您将要从 iframe css 中删除
height: auto,因为您已经在 iframe 属性上定义了height="270" -
是的!我得到了它并从 main.css 中删除了
iframe {}并在 index.html 中使用了<header> <iframe src="header.html" frameborder="0" width="100%" height="240"></iframe> </header>并为我解决了它。
标签: html css iframe header height