2010-04-17 163 views
2

首先,爲什麼在你問的第一個地方使用框架?Frameset在IE中無法正常工作

回答:因爲我的老闆告訴我。

這就是說,我有2個文件。 Index.html和Head.html。

index.html的內容:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd"> 
<html> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> 
     <title>Site Title</title> 
    </head> 
    <frameset rows="122,*" FRAMEBORDER=NO FRAMESPACING=2 BORDER=0> 
     <frame name="t" src="head.html" scrolling="no" marginheight="0" marginwidth="0"> 
     <frame name="b" src="http://www.website.com"> 
    </frameset> 
    <noframes> 
     <p>You have frames turned off on your browser, please turn it on and reload this page.</p> 
    </noframes> 
</html> 

head.html的內容:

<div style="border-bottom:2px solid #000;height:120px"> 
    <center>This is the frame head.</center> 
</div> 

的代碼工作正常除Internet Explorer 7和8的所有瀏覽器(我不關心6)。有什麼我做錯了,如果沒有,那麼沒有框架可以達到同樣的效果,如果是這樣,怎麼辦?

+1

在IE 7中會發生什麼和8表明它不工作? – 2010-04-17 17:19:36

+1

你的代碼適合我。你確定頁面被框住沒有反框架的JavaScript? – Alohci 2010-04-17 18:43:52

回答

0

@ricebowl如果你運行2頁,你會看到網頁試圖被誣陷在IE中完全不顯示,但在所有其他瀏覽器中都顯示出來。

+0

@Cameroon - 您應該使用「添加評論」工具來處理這類信息或編輯您的原始問題 - 請勿創建新答案。 – 2010-04-17 18:09:13

+0

@Martin Smith - 對不起,我無法使用添加評論,因爲我沒有以原始用戶名登錄,我沒有註冊並且意外清除了我的cookies。無論如何,謝謝你指出未封閉的幀標籤。但問題仍然存在。 – Cameroon 2010-04-17 18:13:31

+0

無論如何,我已經刪除了我的答案,因爲我不確定結尾標籤是否需要查看此處的示例http://www.w3.org/TR/REC-html40/present/frames.html。 W3驗證器http://validator.w3.org/check抱怨一些錯誤 - 不確定是否修復這些會有所幫助? – 2010-04-17 18:27:53

0

我試圖在IE 7中,它的工作原理well.i不知道什麼是你的問題。