Skip Links

Among one of the more common, but less implemented ideas on creating accessible web sites is the inclusion of a “skip link”. This is something that users, particularly those aided by a screen reader, can use to skip the repetitive navigation elements and jump to the content unique to the page they’re viewing.

In the past I thought I could get away with a simple link at the start of the page then use screen-media CSS to hide it. This, however, has proven to be a bad assumption. I’ve found many screen readers will first render the web site in the same manner as any web browser like IE or Firefox would. The screen reader then goes through the page looking for text to read back to the user. Thus those hidden elements are also hidden from the screen reader.

So what we need to do is include a link that’s rendered on screen that allows users to skip to the content.

But that’s going to probably just confuse users who aren’t aided by a screen reader. And it might not make sense to others who then might complain that valuable “above the fold” space is being wasted on a link they don’t need.

Enter The Web Standards Project web site. They do precisely this. Except I hadn’t noticed it before today because they simply hide the link by setting the text color of the link to the background color of the page. The link is there. It’s rendered. The screen readers will pick it up, but to the visual user it’s effectively invisible.

Now their solution places the link along the gutter space at the top of the web site. However some web sites don’t really have that kind of gutter space to hide such a link.

So my solution is to use an absolutely positioned element at the top of the HTML document. This removes the element from the flow of the document effectively leaving the layout visually unaltered. I can then position the element wherever I want, including off the page (position-left: -100000px). The link is still there and if you tab through the page you’ll find it’s the first link your browser hits.

However in some situations I may want to make the link visible as a means of advertising that I care about accessibility. Or maybe the link still provides some functional use to visual users, especially for those web sites with a very tall masthead or maybe for those users on mobile devices that only have a two-inch screen.

One option might be that if you have some gutter space on your web site (say five to ten pixels at the to of the page) you might position the element up some number of pixels so that the bottom N pixels of the element are still visible (but the same color as the background). Then perhaps apply a :hover state in your CSS that moves the element down to the page whenever a user hovers over it. In this case users would see the element whenever their mouse crossed the upper five to ten pixels of your layout. Visual users would find it by accident, but then know it was there. I don’t think the popping-out would become an annoyance to users since it’s such a small space to activate that they’d be able to easily avoid it.

Another option might be to just keep the link the same color as the background of the web site, but make the color change in hover state. Again, visual users would only discover this link by accident (or via tabbing), but when they find it they would always know it was there. It’s not as blatant an advertisement on your web site’s focus on accessibility (since the hit space would be so small), but at the very least it’d be something you could at least show/demo for others.

The point is you have options. All of them derived from a simple link and a bit of CSS. It’s a small effort and well worth it to help make your web site more accessible to others.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s