html - 为什么框架集没有加载到页面中?

标签 html css frameset

这是我用于页面的代码:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd”>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title>This page illustrates frame sets</title>
        </head>
        <body>
            <frameset rows="30%,*,20%">
                <frame name="one" src="styledform.html" />
                <frame name="two" src="index.html" />
                <frame name="three" src="form.html" />
            </frameset>
        </body>
</html>

html 文件 styledform.htmlindex.htmlform.html 都与源文件位于同一文件夹中我上面显示的代码。

当我尝试在 Google Chrome 浏览器中打开上述链接时,我看到一个空白页面。 错误是什么?

最佳答案

您的文档中有许多错误 a validator会为您识别。

导致您询问的问题的原因是框架集文档必须具有 <frameset>元素而不是一个<body>元素而不是内部一个。

当浏览器遇到 <body>开始标签,它生成一个常规的 HTML 文档,然后丢弃 <frameset>作为无效。

就是说,不要使用框架。有better alternatives .

关于html - 为什么框架集没有加载到页面中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27816951/

相关文章:

html - C CGI 中的 getenv(QUERY_STRING)

css - Bootstrap - 如何使面板内的字形居中?

html - 如何跨帧显示叠加层?

javascript - 如何使用JS从框架中获取所有链接

html - 在 <frameset> 问题中启用链接

jquery - 扩展子 block 时增加父 block 高度(绝对)

JavaScript Tic tac toe,如何检查图像的位置?

javascript - 如何使字母的赌场式增量?

jquery - css3 开/关开关,不带图像

jquery - 应用主题