What's in a name? In this lesson, I'll explain the concept of naming interactive elements for screen reader users, including forms, buttons, and links. You'll learn how to debug accessible names and descriptions using the Chrome Accessibility Developer Tools (previously a Canary experiment, now in Chrome), using multiple labeling techniques. We'll also listen to the effects of proper accessible names and descriptions in Voiceover and Safari.

For more information and the nitty-gritty browser implementation algorithm, refer to WAI-ARIA 1.1:

Search box:

    <form class="search">
<input aria-labelledby="search-button" />
<button id="search-button">
<span aria-hidden="true" class="icon icon-search"></span>
<span class="visuallyhidden">Search</span>
</button>
</form>

Input field is labelled by the button, button is labelled by the text content.

Read more link:

<a href="#" aria-labelledby="readmore1 readMoreLabel1">
<span id="readmore1">Read more</span>
<span id="readMoreLabel1" class="visuallyhidden"> articles about cute animals</span>
</a>

aria-labelledby can accpet multi ids.

DIalog:

<dialog open role="dialog" aria-label="Newsletter sign up">
<!-- For custom button, we can use aria-label & aria-describedby-->
<custom-button role="button" tabindex="0" aria-label="Cancel" aria-describedby="cancelNote">
X
</custom-button>
<fieldset>
<!-- it is good to use legend to tell users what this form is all about-->
<legend>
<h2>Sign up your favorite friends for our newsletter!</h2>
</legend>
<div>
<!-- label for-->
<label for="dogs">Dog</label>
<input type="text" id="dogs" name="dogs" />
</div> <div>
<!-- best: using both for & label wrapping-->
<label for="cats">
Cat
<input type="text" id="cats" name="cats" />
</label>
</div> <div>
<!-- who else will be the label -->
<label>
Who else?
<input type="text" placeholder="e.g. Frank the Lizard" name="superfriends" />
</label>
</div>
<div>
<input type="submit" value="Submit" />
</div>
</fieldset>
<p id="cancelNote">Closing this dialog will cancel your submission.</p>
</dialog>

[ARIA] What is Accessible Name Calculation?的更多相关文章

  1. [ARIA] Create an Accessible Tooltip on a Text Input

    Here we use HTML and CSS to create a stylish yet semantic tooltip on a form input. I am using aria-d ...

  2. [ARIA] Accessible modal dialogs

    Learn how to create a modal dialog with accessible keyboard and screen reader mechanics using the na ...

  3. ARIA无障碍技术

    ARIA Accessible Rich Internet Applications (ARIA) 规定了能够让 Web 内容和 Web 应用(特别是那些由 Ajax 和 JavaScript 开发的 ...

  4. HTML5+Bootstrap 学习笔记 3

    HTML5 aria-* and role aria是指Accessible Rich Internet Application.role的作用是描述一个非标准的tag的实际作用,而aria-*的作用 ...

  5. ARIA(Accessible Rich Internet Application)

    ARIA 为Web app提供满足用户不同需求的解决方案.建设起用户和软件之间的桥梁. 新的HTML5标准中增加 aria-* 的标签属性,全称Accessible Rich Internet App ...

  6. [ARIA] Accessible animations with reduced motion

    Animations can make people sick, or worse! By adding animation toggles and listening in to the user' ...

  7. [HTML5] Accessible Icon Buttons

    Icon buttons are very common in web applications, yet they often have accessibility problems. Learn ...

  8. web语义化之SEO和ARIA

    在快速理解web语义化的时候,只知道web语义化有利于SEO和便于屏幕阅读器阅读,但并不知道它是如何有利于SEO和便于阅读器阅读的,带着这个疑问,进行了一番探索总结. SEO 什么是SEO? SEO( ...

  9. [翻译]如何在HTML5中有效使用ARIA

    ARIA是Accessible Rich Internet Application的简称,指无障碍富互联网应用.可以使一些有功能障碍(如听力,视力)的人群,使用你的网站.下面看一下做为开发人员的我们, ...

随机推荐

  1. (6)Spring Boot web开发 --- 错误处理页面

    文章目录 处理时间(`Date`)类型 thymeleaf 页面拼接字符串 映射路径占位符 使用 put.delete 方法 错误处理机制 处理时间(Date)类型 Spring Boot 进行参数绑 ...

  2. 在做爬虫或者自动化测试时新打开一个新标签页,必须使用windows切换

    在做爬虫或者自动化测试时,有时会打开一个新的标签页或者新的窗口,直接使用xpath定位元素会发现找不到元素,在firefox中定位了元素还是找不到, 经过多次发现,在眼睛视野内看到这个窗口是在最前面, ...

  3. git彻底删除或变更子模块

    今天遇到一个很怪的问题,我想把我的一个子模块切换到另一个上游,我按照网上的方法删除子模块然后新建后,这个子模块依旧跟踪着我先前的上游.自己摸索了一下,可能方法比较傻,不过是可行的,希望能给大家一些帮助 ...

  4. vue-cli 3.0 端口变5位数

    问题原因 :   portfinder1.0.22版本导致vue-cli-service servey启动后,服务端口变成了随机端口的问题 解决办法: 删了目录 下的node-modules 然后 执 ...

  5. WebHost.CreateDefaultBuilder

    返回WebHostBuilder: 1.用Kestrel做为web服务器,并根据配置提供器内容对其配置. 2.当前目录作为content根目录. 3.从appsettings.json,环境变量,ar ...

  6. 什么叫工业4.0,这篇接地气的文章终于讲懂了(ZT)

    原地址:https://www.cnblogs.com/namei/p/6110382.html 笔者早年从事过工业自动化行业,后来去了几个城市,讲过<工业互联网与工业文明史>这门课,以至 ...

  7. C#不支持XPATH2.0

    .net中的XPATH是1.0版本的,很多2.0中的函数是不兼容的,比如lower-case().replace()函数等,下面中的XPATH语句在运行时会报错 //table[contains(lo ...

  8. python学习笔记(CMD运行文件并传入参数)

    好久没更新博客了 最近换了份新工作 有时间来整理一篇 在命令行CMD中执行文件过程中如何传入并识别参数 # -*- coding: utf-8 -*- # CMD运行类 # 作者: # 时间: 201 ...

  9. robot framework 怎么验证搜索无记录,页面元素不存在

    假设你要验证搜索无记录,页面元素不存在,假设我搜索的文本为你好 页面展示为如下 搜索:你好 假设页面搜索有结果: 你好  class=vtext 你好1  class=vtext 你好2  class ...

  10. [技术翻译]预加载响应式图像,从Chrome 73开始实现

    本次预计翻译三篇文章如下: 01.[译]9个可以让你在2020年成为前端专家的项目 02.[译]预加载响应式图像,从Chrome 73开始实现 03.[译]您应该知道的13个有用的JavaScript ...