What is HTML5 ARIA?

后端 未结 5 1708
故里飘歌
故里飘歌 2020-12-02 04:09

What is HTML5 ARIA? I do not understand how to implement it.

5条回答
  •  庸人自扰
    2020-12-02 04:39

    WAI-ARIA is a spec defining support for accessible web apps. It defines bunch of markup extensions (mostly as attributes on HTML5 elements), which can be used by the web app developer to provide additional information about the semantics of the various elements to assistive technologies like screen readers. Of course, for ARIA to work, the HTTP user agent that interprets the markup needs to support ARIA, but the spec is created in such a way, as to allow down-level user agents to ignore the ARIA-specific markup safely without affecting the web app's functionality.

    Here's an example from the ARIA spec:

    • File
      • New
      • Open…
      • ...
    • ...

    Note the role attribute on the outer

      element. This attribute does not affect in any way how the markup is rendered on the screen by the browser; however, browsers that support ARIA will add OS-specific accessibility information to the rendered UI element, so that the screen reader can interpret it as a menu and read it aloud with enough context for the end-user to understand (for example, an explicit "menu" audio hint) and is able to interact with it (for example, voice navigation).

提交回复
热议问题