noembed element
noembed is obsolete and its content is never displayed, not even when the embed fails; put fallback content inside an object element instead.
- Avoid
- Deprecated
- Severity
- DeprecatedFormally obsolete, but inert.
- Basis
- Obsoleted by the specA standard defined it, then removed it.
- Detectable
- YesMatched exactly. Autofixable when the rule carries a fix.
- Matches
noembedElement rule, inside <body>.- Fix
- None — reports only
- Impacts
- Accessibility and Maintainability
- Related
element/plugin-embed,element/applet
<noembed> was meant to sit next to an <embed> and hold what to show instead when the embedded
content couldn’t play: a link, a picture, a sentence explaining what was missing. It still turns up
beside old media and plug-in embeds.
Why avoid
It is obsolete. The HTML Standard lists noembed among the elements that “are entirely obsolete,
and must not be used by authors”, with the instruction: “Use object instead of embed when
fallback is necessary.”
More to the point, nobody ever sees what’s inside it. The rendering section hides it outright,
alongside script, style and template: noembed { display: none; }. There is no condition
attached, so it stays hidden whether the embed next to it works or not. Its content isn’t even
markup: the parser reads it with “the generic raw text element parsing algorithm”, so a link
written inside is just text.
The embed it was paired with has no fallback either: “The embed element has no fallback content;
its descendants are ignored.” When it fails, the reader gets nothing, and the fallback the author
wrote, often the only accessible alternative to the embedded content, never reaches them.
Use instead
Use object, which has real fallback content: “The object element represents the element’s
children. This is the element’s fallback content.” Whatever you put between its tags is shown when
the resource can’t be:
<object data="chart.svg" type="image/svg+xml" width="600" height="400">
<p><a href="chart.png">View the chart as an image</a></p>
</object>
Detectability
Fully detectable by tag name. deadhead never lints the content of a noembed, because a browser
reads it as text. There is no autofix. Deleting the element would change nothing on screen, since
it’s hidden, but it would also delete the fallback text you still need to move into an object.
Resources
- HTML Standard — Non-conforming features —
noembedis obsolete; useobjectwhen fallback is necessary. - HTML Standard — Rendering: hidden elements —
noembed { display: none; }, unconditionally. - HTML Standard — The embed element —
embedhas no fallback content. - HTML Standard — The object element — an
object’s children are its fallback content. - MDN —
<noembed>— obsolete and non-standard; useobjectwith fallback content between its tags.
This page is generated from content/rules/element/noembed.md, the same file the linter is built from. Think the rule is wrong, or that browsers moved on? Say so — that is the most useful issue you can file.