Skip to main content

HTML Guide

Free site validation

Find out what web pages on your sites are affected by HTML issues.

The “longdesc” attribute on the “img” element is obsolete. Use a regular “a” element to link to the description.

The deprecated property longdesc on img elements was used in HTML4 to specify the URL of a text or HTML file which contained a long-form description of the image. This could be used to provide optional added details beyond the short description provided in the title or alt attributes.

Here’s an example from HTML4:

  alt="Smiling Cat"
  longdesc="image-descriptions/smiling-cat.html" />

This, however, is no longer valid in HTML5 and can be converted to the following instead:

<a href="image-descriptions/smiling-cat.html">
  <img src="cat.jpg" alt="Smiling Cat" />

Learn more:

Related W3C validator issues