大网数据广告活动
Web 标准与前端开发

ARIA: aria-orientation attribute

· 52CE 我爱测

The `aria-orientation` attribute indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.

The aria-orientation attribute indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.

Description

It may be important for the user to know the orientation to know how to navigate certain widgets, as orientation impacts the expected behaviors of the left, right, up and down arrows. The aria-orientation attribute is used to indicate to assistive technology users whether an element's orientation is horizontal or vertical, or undefined.

Several widgets have default orientations:

Horizontal by default:

Vertical by default:

Each separator should have aria-orientation consistent with the separator's orientation.

When nodes in a tree are arranged horizontally instead of its default vertical orientation, or when a tab list is vertical instead of its default horizontal, the down arrow performs as a right arrow normally would, and the up arrow performs as a left arrow normally would. In these instances, assistive technology users need to know the widget's orientation so as to navigate correctly.

Up and down arrows are generally available for normal browser scrolling, even when focus is inside a tree or tab list. Include aria-orientation to enable alerting users when a widget doesn't have the default, expected orientation and associated navigation.

Always remember that ARIA only modifies how assistive technology presents content to your users; altering the behavior of arrow keys requires JavaScript.

Values

  • horizontal
    • : The element is oriented horizontally.
  • undefined (default)
    • : The element's orientation is unknown/ambiguous.
  • vertical
    • : The element is oriented vertically.

Associated interfaces

  • Element.ariaOrientation
    • : The ariaOrientation property, part of the Element interface, reflects the value of the aria-orientation attribute.
  • ElementInternals.ariaOrientation
    • : The ariaOrientation property, part of the ElementInternals interface, reflects the value of the aria-orientation attribute.

Associated roles

Used in roles:

Inherited into roles:

Specifications

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。