簡體   English   中英

iFrame自動高度

[英]iFrame Auto Height

是否可以使用iFrame並使其在所有瀏覽器上正常工作? 還是我不得不使用Javascript。 如果有,有人可以幫助我嗎?

我需要具有自動高度,以便根據需要擴展。

謝謝!

我前段時間找到了解決方案。 它沒有JS,但是您必須使用table 這就是我使用它的方式,也許您需要的更改就很少。

<head>
<style>
*{margin:0;padding:0}
html, body {height:100%;width:100%;overflow:hidden}
table {height:100%;width:100%;table-layout:static;border-collapse:collapse}
iframe {height:100%;width:100%}

.header {border-bottom:1px solid #000}
.content {height:100%}
</style>
</head>

<table>
  <td class="header"></td>
  <td class="content" width="80%" valign="top"><iframe id="reportframe" src="src.html" frameborder="0"></td>
</table>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM