Part 3: Keyboard Focus and hover styling
- Keyboard
focus
andhover
styling should be similar to to harmonize the look and feel of styling between interaction techniques. - Recommend
focus
styling has a border andhover
does not. focus
styling should use a 2 pixelborder
oroutline
width to make the control with focus easy for users to see and track.- If the
border
technique is used theborder
must be removed when the widget does not have focus to support focus styling to change when users select operating system high contrast modes. - Need to use
onfocus
andonblur
events to create focus styling of standard radio buttons and checkboxes by styling their labels. - Styling background color makes the focus change much easier to detect visually.
Example
HTML Source Code
CSS Source Code
Javascript Source Code