我目前正在嘗試使iframe適合我的屏幕大小,以及任何其他用戶在不同分辨率下使用它,除了不管我嘗試什麼,我最終都會iframe太小或高度過大導致雙滾動條。 (iframe和頁面本身具有滾動條)。Iframe/CSS:強制iframe適合屏幕
我的目標是讓iframe只適合頁面寬度的85%(可以工作!),屏幕頂部100px(也可以),然後底部適合我的底部邊緣瀏覽器(這就是我卡住了...)
HTML
<div id="maindiv" class="maindiv">
<iframe id="theiframe" class="iframeautowidth" seamless src="http://whateverdomain.com></iframe>
</div>
CSS:
.maindiv {
width: 85%;
top: 100px;
}
.iframeautowidth {
left: 0px;
top: 0px;
bottom: 0px;
width: 85%;
height: 100%;
border: 0
overflow: hidden;
display: block;
margin: 0;
float: left;
}
如果它可以用於任何事情,我會在頁面上運行最新的jquery,如果它有幫助的話。提前致謝!
巨大的iframe有什麼意義? – reisio 2011-04-19 04:13:35
Tabbing系統;這樣iframe會填充除我自己頂部的100px外的所有頁面。 – Dustin 2011-04-19 04:25:21
你應該使用普通鏈接和無iframe(反而溢出區域),用_redundant_ XHR即時加載,如果你真的想要的話。 – reisio 2011-04-19 18:54:19