Using CSS to Hide Audible Text Off The Screen

Donald F. Evans

May 1, 2011

Question


Answer

Use CSS to hide some text off the screen. In this manner it is hidden from sight, but is still read by the screen reader.


Examples

Hiding Link Text:

<style type="text/css"> a b.hidden { height: 1px; width: 1px; position: absolute; overflow: hidden; top: -999px; } </style> <a href="#">Edit <b class="hidden">Hidden Information</b></a>

Hiding LABEL Tags:

<style type="text/css"> .hidden { height: 1px; width: 1px; position: absolute; overflow: hidden; top: -999px; } </style> <LABEL FOR="foo" class="hidden">Hidden Label</LABEL> <INPUT TYPE="text" ID="foo">

Hiding H Tagss:

<style type="text/css"> .hidden { height: 1px; width: 1px; position: absolute; overflow: hidden; top: -999px; } </style> <hr> <H1 class="hidden">This is a hidden H tag</H1>

Hiding stuff from both visual and screen reader users

.hidden { display: none; visibility: hidden; }

Hiding stuff from the visual user while making it readable to the screen reader.

.visuallyhidden { position: absolute !important; clip: rect(1px 1px 1px 1px); /* for IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); margin: -1px; border: 0; padding: 0; width: 1px; height: 1px overflow: hidden; }

Other Resources