过时
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.
obsolete
property
longDesc
在
HTMLImageElement
interface specifies the URL of a text or HTML file which contains a long-form description of the image.
This can be used to provide optional added details beyond the short description provided in the
title
属性。
descURL = htmlImageElement.longDesc; htmlImageElement.longDesc = descURL;
A
DOMString
which may be either an empty string (indicating that no long description is available) or the URL of a file containing a long form description of the image's contents.
For example, if the image is a
PNG
of a flowchart. The
longDesc
property could be used to provide an explanation of the flow of control represented by the chart, using only text. This can be used by readers both as an explanation, but also as a substitute for visually-impaired users.
此特性是
obsolete
and should no longer be used. Instead of using
longDesc
to provide a link to a detailed description of an image, encapsulate the image within a link using the
<a>
元素。
Consider the following older HTML:
<img src="taco-tuesday.jpg" longDesc="image-descriptions/taco-tuesday.html">
在这里,
longDesc
is used to indicate that the user should be able to access a detailed description of the image
taco-tuesday.jpg
in the HTML file
image-descriptions/taco-tuesday.html
.
This can be easily converted into modern HTML:
<a href="image-descriptions/taco-tuesday.html"> <img src="taco-tuesday.jpg"> </a>
With that, the image is a link to the HTML file describing the image in more detail.
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 4.01 Specification
The definition of 'HTMLImageElement.longDesc' in that specification. |
推荐 | Provides an actual description of this property; the HTML5 spec only says it's deprecated. |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
longDesc
|
Chrome 1 | Edge 12 | Firefox Yes | IE ? | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android ? | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
兼容性未知
HTMLImageElement
BeforeUnloadEvent
DOMStringMap
ErrorEvent
GlobalEventHandlers
HTMLAnchorElement
HTMLAreaElement
HTMLAudioElement
HTMLBRElement
HTMLBaseElement
HTMLBaseFontElement
HTMLBodyElement
HTMLButtonElement
HTMLCanvasElement
HTMLContentElement
HTMLDListElement
HTMLDataElement
HTMLDataListElement
HTMLDialogElement
HTMLDivElement
HTMLDocument
HTMLElement
HTMLEmbedElement
HTMLFieldSetElement
HTMLFormControlsCollection
HTMLFormElement
HTMLFrameSetElement
HTMLHRElement
HTMLHeadElement
HTMLHeadingElement
HTMLHtmlElement
HTMLIFrameElement
HTMLInputElement
HTMLIsIndexElement
HTMLKeygenElement
HTMLLIElement
HTMLLabelElement
HTMLLegendElement
HTMLLinkElement
HTMLMapElement
HTMLMediaElement
HTMLMetaElement
HTMLMeterElement
HTMLModElement
HTMLOListElement
HTMLObjectElement
HTMLOptGroupElement
HTMLOptionElement
HTMLOptionsCollection
HTMLOutputElement
HTMLParagraphElement
HTMLParamElement
HTMLPictureElement
HTMLPreElement
HTMLProgressElement
HTMLQuoteElement
HTMLScriptElement
HTMLSelectElement
HTMLShadowElement
HTMLSourceElement
HTMLSpanElement
HTMLStyleElement
HTMLTableCaptionElement
HTMLTableCellElement
HTMLTableColElement
HTMLTableDataCellElement
HTMLTableElement
HTMLTableHeaderCellElement
HTMLTableRowElement
HTMLTableSectionElement
HTMLTemplateElement
HTMLTextAreaElement
HTMLTimeElement
HTMLTitleElement
HTMLTrackElement
HTMLUListElement
HTMLUnknownElement
HTMLVideoElement
HashChangeEvent
历史
ImageData
定位
MessageChannel
MessageEvent
MessagePort
Navigator
NavigatorGeolocation
NavigatorID
NavigatorLanguage
NavigatorOnLine
NavigatorPlugins
PageTransitionEvent
Plugin
PluginArray
PopStateEvent
PortCollection
PromiseRejectionEvent
RadioNodeList
Transferable
ValidityState
Window
WindowBase64
WindowEventHandlers
WindowTimers