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. 【转帖】K8S Deployment 命令

    K8S Deployment 命令 https://www.cnblogs.com/Tempted/p/7831604.html 今天学习了一下 kubectl scale deployment xx ...

  2. (二)linux 学习 -- 探究操作系统

    The Linux Command Line 读书笔记 - 部分内容来自 http://billie66.github.io/TLCL/book/chap04.html 文章目录 ls 命令进阶 `l ...

  3. 机器学习-EM算法-pLSA模型笔记

    pLSA模型--基于概率统计的pLSA模型(probabilistic Latent Semantic Analysis,概率隐语义分析),增加了主题模型,形成简单的贝叶斯网络,可以使用EM算法学习模 ...

  4. ACM集训

    2019-07-18 09:06:10 emmm.... 昨天5个小时做了一道题,心情复杂,不着急慢慢来 Ivan recently bought a detective book. The book ...

  5. 从ftp获取文件并生成压缩包

    依赖 <dependency> <groupId>commons-net</groupId> <artifactId>commons-net</a ...

  6. Shiro身份认证、盐加密

    目的: Shiro认证 盐加密工具类 Shiro认证 1.导入pom依赖 <dependency> <groupId>org.apache.shiro</groupId& ...

  7. (转)FFmpeg架构之I/O模块分析

    注意:这篇转载的文章比较早,写得很清晰,但是新版的ffmpeg的很多数据结构的名字已经改了.因此只能作参考.(例如ByteIOContext已经改名为AVIOContext) 1概述 ffmpeg项目 ...

  8. (超实用)前端地址栏保存&获取参数,地址栏传输中文不在乱码

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://www.cnblogs.com/autoXingJY/p/115965 ...

  9. [Luogu5319][BJOI2019]奥术神杖(分数规划+AC自动机)

    对最终答案取对数,得到$\ln(Ans)=\frac{1}{c}\sum \ln(v_i)$,典型的分数规划问题.二分答案后,对所有咒语串建立AC自动机,然后套路地$f[i][j]$表示走到T的第i个 ...

  10. 用.net4中的DynamicObject实现简单AOP

    public class DynamicWrapper : DynamicObject { private readonly object source; public DynamicWrapper( ...