Icon buttons are very common in web applications, yet they often have accessibility problems. Learn how to make your icon buttons accessible to keyboard and screen reader users with HTML, CSS, SVG and ARIA.

<!DOCTYPE html>
<html lang="en">
<head>
<title>Button Demo</title>
<link rel="stylesheet" type="text/css" href="css/demo.css">
</head>
<body>
<main> <button>Help!</button> <button>
<span class="visuallyhidden">Help!</span>
<i class="icon icon-help" aria-hidden="true"></i>
</button> <!-- alternate labeling technique: aria-label -->
<button aria-label="Help!">
<i class="icon icon-help" aria-hidden="true"></i>
</button> <div class="button" role="button" tabindex="0">
<svg width="32" height="32" viewBox="0 0 32 32" class="icon" aria-labelledby="svgtitle">
<title id="svgtitle">Help!</title>
<path d="M14 24h4v-4h-4v4zM16 8c-3 0-6 3-6 6h4c0-1 1-2 2-2s2 1 2 2c0 2-4 2-4 4h4c2-0.688 4-2 4-5s-3-5-6-5zM16 0c-8.844 0-16 7.156-16 16s7.156 16 16 16 16-7.156 16-16-7.156-16-16-16zM16 28c-6.625 0-12-5.375-12-12s5.375-12 12-12 12 5.375 12 12-5.375 12-12 12z"></path>
</svg>
</div>
</main>
</body>
</html>
.visuallyhidden {
border:;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding:;
position: absolute;
width: 1px;
}

[HTML5] Accessible Icon Buttons的更多相关文章

  1. HTML5桌面通知(Web Notifications)实例解析

    先上一段代码,ie不支持,Chrome.fireFox.Opera支持 <!DOCTYPE html> <html> <head> <meta http-eq ...

  2. ovirt user guide

    Contents [hide]  1 ⁠Accessing the User Portal 1.1 Logging in to the User Portal 1.2 Logging out of t ...

  3. Website's Game source code

    A Darkroom by doublespeakgames <!DOCTYPE html> <html itemscope itemtype="https://schem ...

  4. SecureCRT中python脚本编写

    SecureCRT中python脚本编写学习指南 SecureCRT python 引言 在测试网络设备中,通常使用脚本对设备端进行配置和测试以及维护:对于PE设备的测试维护人员来说使用较多是Secu ...

  5. ionic button笔记

    源码文件:_button.scss 和 _button-bar.scss,以及_variables.scss(66行-163行). 按钮是手机app不可或缺的一部分,不同风格的app,需要的按钮多种多 ...

  6. SecureCrt脚本(二)二级对象之Dialog

    Crt自动化 测试 SecureCrt脚本 JS脚本   1.引言 2.Dialog属性和方法 2.1.属性 2.2.方法 2.2.1.FileOpenDialog 2.2.2.MessageBox ...

  7. 160908、前端开发框架Semantic UI

    简介 网页开发中,CSS控制网页样式.作为测试开发工程师,我个人不太擅长手写CSS.样式微调.兼容浏览器等工作,所以我选择使用成熟的前端框架,可以快速开发出样式美观的网站,也解决了大部分浏览器兼容问题 ...

  8. jquery.util.easyui.dialog

    (function ($) { var $parent = parent.$; //获取弹出窗口数据集合 function getDialogs() { var dialogs = $parent(& ...

  9. ExtJS4.2.1自定义主题(theme)样式详解

    (基于Ext JS 4.2.1版本) UI组件 学习ExtJS就是学习组件的使用.ExtJS4对框架进行了重构,其中最重要的就是形成了一个结构及层次分明的组件体系,由这些组件形成了Ext的控件. Ex ...

随机推荐

  1. MongoDB实战指南(二):索引与查询优化

    数据库保存记录的机制是建立在文件系统上的,索引也是以文件的形式存储在磁盘上,在数据库中用到最多的索引结构就是B树.尽管索引在数据库领域是不可缺少的,但是对一个表建立过多的索引会带来一些问题,索引的建立 ...

  2. Android自定义属性时format选项可以取用的值

    1. reference:参考某一资源ID. (1)属性定义: <declare-styleable name="名称"> <attr format=" ...

  3. C#操作Access

    C#操作Access数据库的基础知识浅析 C#操作Access数据库的基础知识都有什么呢? C#操作Access数据库的基础知识1. 通过ADO.NET的OleDb相关类来操作Access 主要知识点 ...

  4. 【HDOJ】1203 I NEED A OFFER!

    DP问题. #include <stdio.h> #define MAXNUM 10002 int main() { int m, n; int cost[MAXNUM]; // the ...

  5. USACO4.12Beef McNuggets(背包+数论)

    昨天晚上写的一题 结果USACO一直挂中 今天交了下 有一点点的数论知识  背包很好想 就是不好确定上界 官方题解: 这是一个背包问题.一般使用动态规划求解. 一种具体的实现是:用一个线性表储存所有的 ...

  6. 六月计划#2B(6.10-6.16)

    4/7 STL set 数学 快速傅立叶(FFT) 高斯消元 动态规划 斜率优化

  7. BZOJ2741: 【FOTILE模拟赛】L

    2741: [FOTILE模拟赛]L Time Limit: 15 Sec  Memory Limit: 162 MBSubmit: 1170  Solved: 303[Submit][Status] ...

  8. SVN Working Copy xxx locked 并 cleanup失败之解

    从cmd 进入到 workspace文件夹 执行 上边的命令 --------------------------------------------------------------------- ...

  9. Android图片上传,可以选择多张图片,缩放预览,拍照上传等

    仿照微信,朋友圈分享图片功能 .可以进行图片的多张选择,拍照添加图片,以及进行图片的预览,预览时可以进行缩放,并且可以删除选中状态的图片 .很不错的源码,大家有需要可以下载看看 . 微信 微信 微信 ...

  10. linux下passwd命令设置修改用户密码

    1.passwd 简单说明: 我们已经学会如何添加用户了,所以我们还要学习设置或修改用户的密码:passwd命令的用法也很多,我们只选如下的几个参数加以说明:想了解更多,请参考man passwd或p ...