简体   繁体   English

HTML框架集和框架有问题

[英]Problem with HTML frameset and frame

I am using the below HTML file. 我正在使用以下HTML文件。 The page displays nothing and my text editor is highlighting the frameset tags in yellow color showing it is an error (or warning). 页面什么也不显示,我的文本编辑器以黄色突出显示frameset标记,表明它是错误(或警告)。 What is wrong with this code? 此代码有什么问题?

<html>
    <head></head>
    <body>
        <frameset>
            <frame src="http://google.com/" scrolling="yes">
        </frameset>
    </body>
</html>

Remove the <body> tag. 删除<body>标签。 Also the closing tag </body> 也是结束标记</body>

<html>
    <head></head>

        <frameset>
            <frame src="http://google.com/" scrolling="yes">
        </frameset>

</html>

我相信需要width属性:

<frameset cols="*">

Remove body and add a cols or rows attribute to the frameset. 删除正文,然后向框架集添加cols或rows属性。 Also, reference the Frameset DTD, which will give you the rules for using frames. 另外,请参考框架集DTD,它将为您提供使用框架的规则。

<html>
    <head></head>
    <body>
        <iframe src="http://google.com/" scrolling="yes"/>
    </body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM