【问题标题】:Frameset isn't working in IE框架集在 IE 中不起作用
【发布时间】:2011-05-08 14:27:34
【问题描述】:

首先,为什么要首先使用框架集?

回答:因为我老板告诉我的。

也就是说,我有 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)之外的所有浏览器中都能正常工作。有什么我做错了,如果没有,那么没有框架可以达到同样的效果吗?如果可以,怎么做?

【问题讨论】:

  • 在 IE 7 和 8 中发生了什么表明它不起作用?
  • 您的代码对我有用。您确定被加框的页面没有反加框 javascript 吗?

标签: html css internet-explorer frameset


【解决方案1】:

@ricebowl 如果你运行这 2 个页面,你会看到试图被加框的网站在 IE 中根本不显示,但在所有其他浏览器中都显示。

【讨论】:

  • @Cameroon - 您应该对此类信息使用“添加评论”工具或编辑您的原始问题 - 不要创建新答案。
  • @Martin Smith - 抱歉,我无法使用添加评论,因为我没有使用原始用户名登录,我没有注册并意外清除了我的 cookie。无论如何,感谢您指出未闭合的框架标签。但是问题仍然存在。
  • 无论如何我已经删除了我的答案,因为我不确定是否需要结束标签查看此处的示例w3.org/TR/REC-html40/present/frames.html。 w3 验证器 validator.w3.org/check 抱怨一些错误 - 不确定修复这些是否有帮助?
  • 顺便说一句,当我创建这 2 个页面时,您发布的 HTML 在 IE8 中对我来说很好。
【解决方案2】:

我在IE 7中试过,效果很好。我不知道你到底是什么问题。

【讨论】:

    猜你喜欢
    • 2012-03-06
    • 1970-01-01
    • 2010-10-13
    • 1970-01-01
    • 1970-01-01
    • 2020-06-23
    • 2015-05-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多