longdesc屬性指定指向圖像詳細(xì)描述的超鏈接。
有關(guān)如何使用longdesc屬性的幾個(gè)示例:
<!DOCTYPE html> <html> <head> <title>HTML:<img> longdesc 屬性 - 菜鳥教程 (cainiaoplus.com)</title> <body> <!-- The description is on the same page as the image --> <img src="sun.gif" alt="(cainiaoplus.com)" width="100" height="132" longdesc="#nhooo_Explained"> <!-- The description is in an external page --> <img src="sun.gif" alt="(cainiaoplus.com)" width="100" height="132" longdesc="nhooo.txt"> <!-- The description is one of several within an external page --> <img src="sun.gif" alt="(cainiaoplus.com)" width="100" height="132" longdesc="http://example.com/desc#item3"> <!-- The description is included in a data:URI --> <img src="sun.gif" alt="(cainiaoplus.com)" width="100" height="132" longdesc="data:text/html;charset=utf-8;,%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Ctitle%3EDescription%20of%20the%20Logo%3C/title%3E%3C/head%3E%3Cbody%3E%3Cp%3ESome%20description%20goes%20here%3C/body%3E%3C/html%3E"> <div id="nhooo_Explained"> <h2>Image sun.gif</h2> <p>Description of the image...</p> </div> </body> </html>測(cè)試看看 ?/?
IEFirefoxOperaChromeSafari
幾乎所有的主流瀏覽器都不支持 longdesc 屬性。
HTML5 不支持 <img> longdesc 屬性。
longdesc屬性指定指向圖像詳細(xì)描述的超鏈接。
提示:由于瀏覽器對(duì) longdesc 屬性的支持性非常差,沒(méi)有必要使用該屬性。如需為某個(gè)圖像提供長(zhǎng)描述(如果有必要的話),只要簡(jiǎn)單地創(chuàng)建一個(gè)指向描述頁(yè)面的鏈接即可(該鏈接對(duì)任何人都是可見的)。
<img longdesc="URL">
值 | 描述 |
---|---|
URL | 超鏈接到的圖像的詳細(xì)說(shuō)明。 可能的值: 一個(gè)ID另一個(gè)元素 絕對(duì)URL - 指向另一網(wǎng)站(如LONGDESC =“http://www.example.com/description.txt”) 相對(duì)URL - 指向一個(gè)網(wǎng)站內(nèi)的文件(如LONGDESC =“description.txt”) |