2011-08-03 26 views
0

我有一個框架集,每個框架都有一個表格width:100%。在IE 8和9中,表格並沒有填滿整個窗口,而是有一個奇怪的右邊距。在所有其他瀏覽器中,它工作正常。IE預留了框架中滾動條的空間

space reserved for scrollbar

我證實,它不涉及保證金/填充,是因爲如果我改變滾動條寬度在控制面板中,預留空間的變化也有滾動條來辦。如果頁面在框架之外查看,則不會發生此問題。

這是滯後碼。每幀有scrolling=auto。從互聯網上我看到了兩個相關的討論:

但我仍然無法找到一個解決方案。將scroll=no添加到頁面的主體將消除空間,但這可以防止在需要時顯示滾動條。我嘗試了其他一些解決方案,但還找不到完整的解決方案。

編輯:這隻發生在垂直拆分框架。

示例代碼:

的index.html

<html> 
<frameset rows="150,*" cols="*" framespacing="0" border="0" frameborder="no"> 
<frame scrolling="auto" noresize src="top.html" name="menu"> 
<frame scrolling="auto" noresize src="bottom.html" name="main"> 
</frameset> 
</html> 

的top.html

<html> 
<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 bgColor="#AAFFAA"> 
<table cellspacing=0 cellpadding=0 width="100%" border=1> 
<tr> 
<td width="100%" align=middle>TOP<td> 
</tr> 
</table> 
</body> 
</html> 

的bottom.html

<html> 
<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 bgColor="#FFAAAA"> 
<table cellspacing=0 cellpadding=0 width="100%" border=1> 
<tr> 
<td width="100%" align=middle>bottom<td> 
</tr> 
</table> 
</body> 
</html> 
+0

發佈您的代碼/網站將在解決方案幫助。 –

回答

2

對不起我不能在這個問題下評論。

您是否試圖用oveflow替換滾動?

試着增加風格overflow: auto:overflow-x: auto; overflow-y: hidden;

+0

是的,它的工作原理。你介意把我的發現加入你的答案嗎? 最後我發現通過在子頁面的body元素上使用'style =「overflow:auto」可以解決問題。 ' lulalala