deborah: the Library of Congress cataloging numbers for children's literature, technology, and library science (Default)
deborah ([personal profile] deborah) wrote in [site community profile] dw_dev2010-07-14 06:34 pm

new accessibility css for developers

Sometimes -- very rarely, but sometimes -- there needs to be text made available to screenreaders, but hidden from people using standard, CSS-aware visual browsers. In general, this is something that should be avoided, but there are valid use cases. For example, tag clouds, in which the size of the typeface is (usually) invisible to screenreaders and people using text-only browsers, but that typeface size includes semantic information. Hiding text from everyone except for CSS-unaware browsers makes it possible to reveal that information to screenreaders and text-only browsers without providing redundant information to visual browsers.

lj_base.css contains a new class, "invisible".

.invisible {
position:absolute;
left:-10000px;
top:auto;
}

Using this class will make text visible for screenreaders and CSS-unaware browsers, but hidden from everyone using CSS. Use this sparingly!

Example: <span class ="invisible">Nobody with CSS turned on can see me!</span>
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)

[personal profile] pauamma 2010-07-14 11:06 pm (UTC)(link)
I'm not a CSS expert, (or an accessibility expert), so I'm probably miçssing something, but why not use display: none for that class?
cesy: "Cesy" - An old-fashioned quill and ink (Default)

[personal profile] cesy 2010-07-15 08:48 am (UTC)(link)
Because then it doesn't show up to most screenreaders, either.
alierak: (Default)

[personal profile] alierak 2010-07-15 05:52 pm (UTC)(link)
More similar tips from WebAIM. Any comments on the differences between their "hidden" class and your "invisible", or the rest of that article?
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)

[personal profile] matgb 2010-07-16 03:18 pm (UTC)(link)
Is this currently live, or does it not work within posts? I did a test post and can't get it to work on my layout or site scheme layouts.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2010-07-16 03:19 pm (UTC)(link)
Won't be live until the next code push.