23/09/03
skip navigation links
A recent article at The Web Standards Project alerted designers that ‘Skip Navigation’ links, traditionally hidden with the CSS property display:none, are invisible to screenreaders. This hadn’t occurred to me, even though I knew it was a problem with Fahner Image Replacement, which also uses display:none.
If you’ve got a long list of navigation links, skip links give users the option to go straight to the content, useful if you have a textbrowser, PDA or screenreader (doh!). It can be particularly painful to hear a screenreader speak al long list of links before finally getting to the content.
Put ‘em somewhere else
One way around this is to use a layout technique that allows navigation to be placed after the content, removing the need for the link. The Layout Reservoir at Blue Robot has useful examples on how this can be done. Navigation is positioned using position:absolute, which takes it out of the normal flow of the page, allowing it to go anywhere in your HTML. This won’t always be possible of course, and if you do, you’ll need to add a ‘skip to navigation’ link instead!
Hide ‘em
The following workaround was developed by Bob Easton, who wrote the original article on CSS Discuss, and works in the top 3 screenreaders – Jaws 4.51, Window-Eyes 4.5(beta) and IBM Home Page Reader 3.02.
<div class="skiplink"><a href="#content">Skip Navigation</a> </div>
.skiplink {
position: absolute;
left: -1000px;
width: 990px;
font-size:1px; line-height:1;
}
As you can see, it places the content off the screen to the left. Bob also added width, font-size and line-height to allow for extra information such as a menu of your accesskeys. The width rule is a failsafe, to make sure that div doesn’t become visible. If your link is a small simple affair, you can remove the width and font attributes. Tom Gilder extends this further , with a clever technique that makes the div visible when a user is tabbing through.
Don’t hide ‘em
However, Joe Clark argues the case for making these links visible. He lists several ways of doing this, and keeping it small, suggesting that just the word ‘skip’ would be acceptable.
9
Tags: 


Previous





Download our vCard
patrick h. lauke said 1829 days ago:
i've been toying with a different approach to skip links, both hiding them (via hidden overflow and text indent) and making them visible on hover/focus. best of both worlds, methinks.implemented on the test page for www.activestreaming.com
might be writing a little article for www.accessify.com about it soon...
Jon Hicks said 1829 days ago:
Patrick,Thats a good idea to use the negative text indent method. Have you been able to test it in screenreaders? Let us if the article happens...
charles said 1798 days ago:
does a negative text-indent value validate? nice technique though.Jon Hicks said 1797 days ago:
It certainly does, I currently use it on this site.David said 1771 days ago:
Is there a reason not to use.skiplink{
width:0;
height:0;
overflow: hidden
}
?
Jon Hicks said 1771 days ago:
Yes - it doesn't work in all 3 major screenreaders. This was the orginal method that I'd tried, see this post:http://www.hicksdesign.co.uk/journal/archives/000147.php
The method above does work in all 3 however.
David said 1771 days ago:
Thanks -- I'd tested it in Jaws 5 and it worked. Just as with visual browsers, I guess you can't assume consistent interpretation of your page amongst all screenreaders.Marc said 1760 days ago:
Your example would not work: You useclass="hide"
in your XHTML and
.skiplink
in your CSS. Just a little note... :-)
Jon Hicks said 1760 days ago:
Doh! Fixed now - thanks for the heads up!