Form input placeholder
attributes are helpful for providing tips to (sighted) users on the format of content required. Often times, due to design decisions, a placeholder
is used to replace a more semantic label
element. Unfortunately, accessible placeholder
browser support isn't complete and placeholder often lack sufficient color contrast.
- Redesign to include a proper
label
- Use
aria-label
oraria-labelledby
to provide assistive text - Visually hide
label
elements (in an accessible manner)
While we're paying attention to our placeholder text, be sure to add better contrast to you placeholder text:
::moz-placeholder,
::-webkit-input-placeholder,
:-ms-input-placeholder {
color: #626262; /* 4.5:1 contrast ratio on #FFFFFF */
}
- HTML5 Accessibility Chops: the placeholder attribute from the Paciello Group (February 2011)
Making notes.
#626262
for a 4.5:1 ratio.