导航
×
   ❮   
HTML CSS JavaScript PHP Go Sass W3C Colors ECMS

HTML 参考手册

HTML 元素(功能排序) HTML 浏览器支持 HTML 属性 HTML 全局属性 HTML 事件 HTML 颜色 HTML 画布 HTML 音频/视频 HTML 字符集 HTML 文档类型 HTML URL 编码 HTML 语言代码 HTML 国家代码 HTTP 状态消息 HTTP 请求方法 PX-EM 转换 键盘快捷键

HTML 标签

<!--> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <img> longdesc 属性


实例

关于如何使用longdesc属性的几个示例:

<!-- The description is on the same page as the image -->
<img src="w3html.gif" alt="freew3c.com" width="100" height="132" longdesc="#w3htmlExplained">

<!-- The description is in an external page -->
<img src="w3html.gif" alt="freew3c.com" width="100" height="132" longdesc="w3html.txt">

<!-- The description is one of several within an external page -->
<img src="w3html.gif" alt="freew3c.com" width="100" height="132" longdesc="http://example.com/desc#item3">

<!-- The description is included in a data:URI -->
<img src="w3html.gif" alt="freew3c.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。

可能的值:

  • An id to another element
  • 绝对 URL - 指向另一个网站 ( 比如 longdesc="http://www.example.com/description.txt")
  • 相对 URL - 指向网站中的文件 ( 比如 longdesc="description.txt")

Copyright ©2020-2026 freew3c.com All Rights Reserved 提供的内容仅用于学习和测试,不保证内容的正确性。