HTML <noembed> 标签用于处理不支持 <embed> 标签的浏览器。<noembed> 标签可以轻松提供替代内容,告诉用户他们缺少什么。
不再建议使用<noembed> 标签,因为它已弃用,在 HTML5 中不受支持。
语法
<noembed> .. </noembed>
属性
HTML noembed 标签不接受任何属性。
HTML <noembed> 标签示例
下面的示例将说明 <noembed> 标签的用法。在浏览器不支持嵌入标签的情况下,何时以及如何使用 noembed 标签。
嵌入失败时的替代内容
考虑以下示例,如果浏览器试图支持 embed 标记,我们将在 <noembed> 标记中使用 text forn 中的备用包含。
<!DOCTYPE html>
<html>
<head>
<title>HTML noembed Tag</title>
</head>
<body>
<embed src=
"https://www.qikepu.com/cg/images/logo.png"
width="300" height="100">
<noembed>
<p>
Your Browsers does not Support Embed Tag
</p>
</noembed>
</embed>
</body>
</html>
嵌入失败时的备用图像
考虑以下示例,如果浏览器支持嵌入标记,我们将在 <noembed> 标记中使用备用图像。
<!DOCTYPE html>
<html>
<head>
<title>HTML noembed Tag</title>
</head>
<body>
<embed src=
"https://www.qikepu.com/cg/images/logo.png"
width="300" height="100">
<noembed>
<img src=
"https://www.qikepu.com/cg/images/logo.png"
alt="Alternative Media">
</noembed>
</embed>
</body>
</html>
支持的浏览器
浏览器 | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
是否支持 | 1.0 | 12.0 | 1.0 | 4.0 | 15.0 |