HTML <noframes> 标签用于处理不支持 <frame> 标签的浏览器。此标记用于显示备用文本消息。
不再建议使用此标记,因为它已弃用,在 HTML5 中不受支持。
语法
<noframes> .. </noframes>
属性
<noframes> 标签支持 HTML 的 全局属性 。
下面的示例将说明 <noframes> 标签的用法。在浏览器不支持帧标签的情况下,何时以及如何使用 noframes 标签。
HTML <noframes> 标签示例
下面的示例将说明noframes标签的用法。在何处、何时以及如何使用 noframes 标签,以及当浏览器不支持 frames 标签时。
帧失败时的替代内容
考虑以下示例,如果浏览器无法支持 frame 标记,我们将在 <nofarmes> 标记中使用文本中的备用包含。
<!DOCTYPE html>
<html>
<head>
<title>HTML noframes Tag</title>
</head>
<frameset cols="200, *">
<frame src=
"https://www.qikepu.com/cg/images/logo.png" />
<frame src=
"https://www.qikepu.com/static/images/hero.png" />
<noframes>
<body>
Your browser does not support frames.
</body>
</noframes>
</frameset>
</html>
嵌入失败时的备用图像
考虑以下示例,如果浏览器支持帧标记,我们将在 <onframes> 标记中使用备用图像。
<!DOCTYPE html>
<html>
<head>
<title>HTML noframes Tag</title>
</head>
<frameset cols="200, *">
<frame src=
"https://www.qikepu.com/cg/images/logo.png"/>
<frame src=
"https://www.qikepu.com/static/images/hero.png"/>
<noframes>
<body>
<img src=
"https://www.qikepu.com/cg/images/logo.png"/>
<img src=
"https://www.qikepu.com/static/images/hero.png"/>
</body>
</noframes>
</frameset>
</html>
支持的浏览器
浏览器 | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
是否支持 | 1.0 | 12.0 | 1.0 | 4.0 | 15.0 |