Menu Button: High Contrast Support
Example
Menu Button: Keyboard, ARIA and high contrast on WebEdit
High Contrast Support
- When
buttondoes not have focus, CSSborderproperty is set to1px. - When
buttondoes have focus, CSSborderproperty is set to3pxand padding is reduced by2px. - When
menuitemdoes not have focus, CSSborderproperty is set tonone. - When
menuitemdoes have focus, CSSborderproperty is set to2pxand padding is reduced by2px.
ARIA Markup
Button Element
- Button element has the default role of
button. -
aria-haspopup="true"attribute. -
aria-controlsattribute references theidof the element with themenurole. -
aria-expanded="true"when menu is open, otherwise attribute is not present. - Accessible name for the button comes from the text content of the button element.
Menu and Menuitem Elements
- Container
ulelement has therole="menu". - Container
ulelement has thearia-labelledby="id-mb"to provide an accessible name for the menu. -
aelements have therole="menuitem". -
lielements have therole="none", since the list item semantics are not needed due to themenuitemroles being on theaelements. - Accessible name for the menu items comes from the text content of the anchor elements.
HTML Source Code
CSS Source Code
Javascript Source Code