skip navigation

The Ohio State University

  1. Help
  2. Campus map
  3. Find people
  4. Search OSU


Web Accessibility Center home page.

  • Web Accessibility Center



Test of methods for hidden label information in forms.

[traditional label tag is visible to all users]

Method 1: CSS -- limit size of display area

[label is placed in a div that is limited to 0px in height and width via CSS. Overflow is set to "hidden"]

[another traditional label tag (for testing)]

Method 2: CSS -- display:none

[label "display" attribute set to "none" via CSS]

Method 3: CSS -- visibility:hidden

[label "visibility" attribute is set to "hidden" via CSS]

Method 4: IMG -- invisible GIF with ALT tag

[label is created through ALT tag on invisible GIF]

Method 5: CSS -- margin off-screen

[label is displayed off-screen using negative "margin-left" with "Overflow" set to "hidden"]

Discussion

Tested with Assistive Technology on Windows XP Professional machine displayed in Internet Explorer version 6.0. Window-Eyes test was on Window 2000 machine.

Additionally displayed this form in: Netscape 8 Beta (0.9.6), Netscape 4.8, Mozilla Firefox 1.0.4, and Opera 8.0 on Windows XP Professional and Internet Exporer for Mac 5.2 and Safari 1.0.3 on MAC OS 10 (v.10.2.8) with no noted problems with display or form input.

Method 1: CSS -- limit size of display area

Method 1 Results
Screen Reader Reads Label Tag?
JAWS 6.0
Yes
JAWS 5.10
Yes
JAWS 5.0
Yes
Window-Eyes 5.0
Yes
Home Page Reader 3.021
Yes

CSS Definition:

#invisible1 {
	height: 0px;
	width: 0px;
	overflow: hidden;
}

Comments: Nice, clean method. Keep in mind that text will re-appear on browsers that do not support this CSS method (consider how text appearing may affect your layout).

Method 2: CSS -- display:none

Method 2 Results
Screen Reader Reads Label Tag?
JAWS 6.0
Yes
JAWS 5.10
Yes
JAWS 5.0
Yes
Window-Eyes 5.0
Yes
Home Page Reader 3.021
Yes

CSS Definition:

.invisible2 {
	display: none;
}

Comments: Unlike the "hidden" option below, browsers do not leave blank space where text would appear. However, this option is not supported by older versions of AT.

Method 3 : CSS -- visibility:hidden

Method 3 Results
Screen Reader Reads Label Tag?
JAWS 6.0
Yes
JAWS 5.10
Yes
JAWS 5.0
Yes
Window-Eyes 5.0
Yes
Home Page Reader 3.021
Yes

CSS Definition:

.invisible3 {
	visibility: hidden;
}

Comments: Space where label text would appear is still maintained in browser; moves text box to the right.

Method 4 : IMG -- invisible GIF with ALT tag

Method 4 Results
Screen Reader Reads Label Tag?
JAWS 6.0
No
JAWS 5.10
No
JAWS 5.0
No
Window-Eyes 5.0
No
Home Page Reader 3.021
Yes

HTML Code:

<label for="t3"><img src="../images/1by1.gif" alt="Method 4 input:" /></label>
    

Comments: Not a good option. Only supported by Home Page Reader.

Method 5: CSS -- margin off-screen

Method 5 Results
Screen Reader Reads Label Tag?
JAWS 6.0
Yes
JAWS 5.10
Yes
JAWS 5.0
Yes
Window-Eyes 5.0
Yes
Home Page Reader 3.021
Yes

CSS Definition:

#invisible4 {
	margin-left: -1000px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	padding: 0px;
	overflow: hidden;
	position: absolute;
}

Comments: Negative margins not supported by some browsers (e.g. Safari). Test on additional platforms. Use absolute positioning to avoid extra spacing.

 

 

 

OSU Web Accessibility Center (WAC)
1760 Neil Ave 150 Pomerene Hall Columbus, Ohio 43210
Phone: (614) 292-1760 Fax: (614) 292-4190 E-mail: webaccess@osu.edu
For questions or problems with this site, including incompatibility with assistive technology, email the WAC Webmaster.

 

 

Our Partners