Saturday, December 8, 2012

Variants of Hiding Element


Mechanisms for Hiding Content
CSS RulesDisplay EffectAccessibility Effect
visibility: hidden;Element is hidden from view, but is not removed from the normal flow (i.e., it still takes up the space it normally would)Content is ignored by screen readers
display: none;Element is removed from the normal flow and hidden; the space it occupied is collapsedContent is ignored by screen readers
height: 0; width: 0; overflow: hidden;Element is collapsed and contents are hiddenContent is ignored by screen readers
text-indent: -999em;Contents are shifted off-screen and hidden from view, but links may “focus” oddly and negative indent may not prove long enough to fully hide contentScreen readers have access to the content, but the content is limited to text and inline elements
position: absolute; left: -999em;Content is removed from the normal flow and shifted off the left-hand edge; the space it occupied is collapsedScreen readers have access to the content
Good Reference : http://snook.ca/archives/html_and_css/hiding-content-for-accessibility


No comments: