YouTip LogoYouTip

Att Img Longdesc

# HTML longdesc Attribute The `longdesc` attribute of the `` tag is used to provide a URL to a detailed, long description of an image. This is particularly useful for complex images, such as charts, graphs, or diagrams, where a simple `alt` text is insufficient to convey all the information. --- ## Definition and Usage The `longdesc` attribute specifies the URL of a page or document that contains a long description of the image. > **⚠️ Deprecation Warning:** > **HTML5 does not support the `longdesc` attribute.** > Due to extremely poor browser support and lack of visibility for sighted users, this attribute has been deprecated. It is highly recommended to use modern accessibility alternatives instead. --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | *URL* | The URL pointing to the page containing the image description.

**Possible values:**
β€’ **Absolute URL:** Points to another website (e.g., `longdesc="https://www.example.com/desc.txt"`)
β€’ **Relative URL:** Points to a file within the same website (e.g., `longdesc="description.txt"`) | --- ## Code Examples ### Basic Usage (Legacy) In legacy systems, the `longdesc` attribute was implemented as follows: ```html Sales Chart for Q4 2023 ``` ### Modern Alternatives (Recommended) Since `longdesc` is obsolete and unsupported by almost all modern browsers, you should use one of the following accessible alternatives: #### Option 1: Using a Standard Text Link (Best Practice) The simplest and most accessible approach is to place a visible link to the description page directly below or near the image. This benefits all users, including those who are visually impaired. ```html
Sales Chart for Q4 2023
Figure 1: Sales Chart for Q4 2023. View a detailed text description of this chart.
``` #### Option 2: Using WAI-ARIA Attributes (`aria-describedby`) If the description is present on the same page, you can link the image to the description container using the `aria-describedby` attribute. ```html Sales Chart for Q4 2023

This chart shows a 15% increase in sales during October, a steady plateau in November, and a peak of 45% growth in December 2023.

``` --- ## Browser Support | Chrome | Edge | Firefox | Safari | Opera | | :---: | :---: | :---: | :---: | :---: | | ❌ Not Supported | ❌ Not Supported | ❌ Not Supported | ❌ Not Supported | ❌ Not Supported | Almost all modern mainstream browsers do not support or have dropped support for the `longdesc` attribute. Screen readers may still offer limited support, but relying on it is discouraged for modern web development.
← Att Img SrcAtt Img Ismap β†’