HTML <img> longdesc 属性
实例
关于如何使用longdesc属性的几个示例:
<!-- The description is on the same page as the image -->
<img src="bthtml.gif" alt="begtut.com" width="100" height="132" longdesc="#bthtmlExplained">
<!-- The description is in an external page -->
<img src="bthtml.gif" alt="begtut.com" width="100" height="132" longdesc="bthtml.txt">
<!-- The description is one of several within an external page -->
<img src="bthtml.gif" alt="begtut.com" width="100" height="132" longdesc="http://example.com/desc#item3">
<!-- The description is included in a data:URI -->
<img src="bthtml.gif" alt="begtut.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">
亲自试一试 »
<img src="bthtml.gif" alt="begtut.com" width="100" height="132" longdesc="#bthtmlExplained">
<!-- The description is in an external page -->
<img src="bthtml.gif" alt="begtut.com" width="100" height="132" longdesc="bthtml.txt">
<!-- The description is one of several within an external page -->
<img src="bthtml.gif" alt="begtut.com" width="100" height="132" longdesc="http://example.com/desc#item3">
<!-- The description is included in a data:URI -->
<img src="bthtml.gif" alt="begtut.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">
定义和用法
longdesc 属性规定包含图像的长描述的页面的 URL。
提示: 由于浏览器对 longdesc 属性的支持性非常差,没有必要使用该属性。如需为某个图像提供长描述(如果有必要的话),只要简单地创建一个指向描述页面的链接即可(该链接对任何人都是可见的)。
浏览器支持
属性 | |||||
---|---|---|---|---|---|
longdesc | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 |
语法
<img longdesc="string">
属性值
值 | 描述 |
---|---|
string | 指向图像描述页面的 URL。 可能的值:
|