WCAG 2.0 Sucess Criterion 2.4.4 says:

2.4.4 Link Purpose (In Context): The purpose of each link can be determined from the link text alone or from the link text together with its programmatically determined link context, except where the purpose of the link would be ambiguous to users in general. (Level A)

The purpose of this Success Criterion is to allow users to have the information necessary in order to determine whether the link takes them to content they'd want to consume. There is a related Success Criterion, 2.4.9, which calls for "... the purpose of each link to be identified from link text alone..." (meaning out of context). In either case, it is our opinion that, in cases where the link points the user to non-native content - meaning file types viewable directly in the browser - that the link text also convey to the user the type of content that will be delivered.

A Misguided Solution

Some developers may feel compelled to use new CSS3 selectors to add generated content to each link. One method which one may do so is as follows:

a[href $='.pdf']:after {

Unfortunately this generated content isn't present in the DOM and therefore is not available to assistive technologies. This generated content is available visually only, which does help some users, but leaves many out. Additionally, even if the image was available in the DOM, this method doesn't provide the ability to supply a text alternative.

Preferred Approach

We can definitely see the utility of not including any extra code in the actual content and instead handling this using JavaScript or jQuery. Doing so allows content creators to just keep to the creation of content. The ideal approach will add information to the link itself and append the necessary information directly to the link. For example:

$('a[href$=".zip"]').append('<img src="/img/icons/zip.gif" alt=" (Opens a Zip File) " />');

This method adds the content directly to the DOM, within the link itself, and allows for a text alternative. The end result looks like this:

If you desire, you can download all files