过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
过时
HTML Image element (
<image>
)
is an obsolete remnant of an ancient version of HTML lost in the mists of time; use the standard
<img>
element instead.
Seriously, the specification even literally uses the words "Don't ask" when describing this element.
Do not use this!
In order to display images, use the standard
<img>
元素。
While some browsers will attempt to automatically convert this into an
<img>
element, they won't always do so, and won't always succeed when they try, due to various ways in which the options can be interpreted. So just don't use it if you like your users.
This might have once been part of a specification, but nobody seems to remember. It certainly isn't anymore. Just avoid it like the plague.
In general, browsers will attempt to map this to
<img>
, but only if the
src
attribute is specified as well. Creating an
<image>
element without a
src
attribute results in an
HTMLElement
object with the local element name
"image"
. However, if the element is created with a
src
attribute, the result is instead an
HTMLImageElement
and its local element name is changed to
"img"
.
However, that doesn't mean this is a good idea to use. It's not.
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Firefox for Android | Opera for Android | Safari on iOS | Samsung Internet | |
image
弃用
非标
|
Chrome ? | Edge ? |
Firefox
完整支持
Yes
注意事项
|
IE ? | Opera ? | Safari ? | WebView Android ? | Chrome Android ? |
Firefox Android
完整支持
Yes
注意事项
|
Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
完整支持
兼容性未知
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
见实现注意事项。
<img>
: The correct way to display an image in a document
<picture>
: A more powerful correct way to display an image in a document
<image>