2010-04-17 156 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不知道什么是你的问题。