Archive for the 'CSS' Category

Why “left: -9999px;” is Better For Accessibility Than “display: none;”

February 14th, 2007 by Nick Fitzsimons

Update: Thierry Koblentz points out in the comments that either technique may be appropriate, depending on circumstances. I mention this in the last paragraph, but just to be clear, there should have been a “usually” or “often” or some such word in front of the “better” of the title. That, or a different title.

Update 2, December 2008: It is now accepted that it is better to use top: -9999px;, as using left: would cause a scroll bar on a page with right-to-left text.

A recurring question on various mailing lists such as the Web Standards Group discussion list is “How can I hide content but still have it accessible?” This is usually asked in the context of image replacement techniques, where one might for example wish to display a heading in a fancy typeface, but still have the content accessible to users of assistive technologies such as screen reading software.
Read the rest of this article »

Quirks or Strict: a Quick Way to Tell

June 4th, 2006 by Nick Fitzsimons

If you’re working with (X)HTML and CSS you’ll be aware – or you need to be aware – that browsers render pages differently depending on whether they are in Strict or Quirks mode. (There are explanations of what these terms mean from Microsoft and Mozilla.) It can be useful to have a way of making certain which mode you’re in when tracking down inconsistencies in browser behaviour.
Read the rest of this article »