Should the HTML file that a longdesc attribute (assigned to an img tag) points to, contain any markup?

Should the HTML file that a longdesc attribute (assigned to an img tag) points to, contain any markup, or should it just be text (not wrapped in any tags)?

Answers


HTML5 Image Description Extension (longdesc) (Working Draft) says:

It’s not clear to me if the requirement about structured markup is for implementors only or if it affects authors, too. If it concerns authors, using a plain text document wouldn’t be allowed, as these can’t contain "rich markup" (unless … well, it depends on the definition of rich markup). But I assume this requirement is for people implementing longdesc only (e.g., in CMS).

A "broadly accessible format" is not very well defined, either.

I guess in the end it should be fine to link to a document which your users can access. HTML would be a pretty safe bet, obviously. A plain text document should work, too, if it doesn’t contain a complex description which would need structured markup (see the the "Requires" lines in the example use cases).


There are a few options in the HMTL5 spec extension for longdesc, but the simplest thing is to have the description as a page.

I.e. From the image longdesc, target a separate page that is there purely to describe the image. As user-agent support is pretty poor, I would also include that as a link under the image that goes to the description page.

You can link to other things (e.g. plain text), but using a standard HTML page in your usual template is fine (assuming the template is reasonable accessible).


W3C does not specify explicitly whether it can or cannot contain the tags. But given that it needs to be a valid URL, the linked page should allow HTML formatting within it. To avoid this dilemma completely it is better to put the description of the image on the page itself and link it in the "longdesc" with #anchor-name of the section.


yes. not always, but most often, longdesc is going to be used by visually impaired users....who rely on screenreaders...which rely on content being appropriately marked up, to provide the best possible ux. in my opinion, you've already made the correct decision to use longdesc, yay! most people could careless. so why stop there? what's a few <h1> and <p> elements (usage will vary) going to hurt?


Need Your Help

php://input contains data for a GET request

php apache2

I am running Apache2 and PHP 5 on Linux, and I'm getting some strange behavior with the php://input stream.

Is there any way for my application to know a user has added a Twitter account?

ios twitter

Whenever you try and present a TWTweetComposeViewController and a user has no Twitter account added to their device they are prompted to go to the Settings app and add one. Once they are done they ...