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)
Anything I can do here to help get this out the door? @clarehyam is right about needing to separate it. If not, what happens is it reads from top to bottom so if the top selector isn't for the browser reading it, it will ignore the selectors after that rather than check through all of them until one applies.