html - role="presentation" 或 aria-hidden="true" 用于装饰图像?
问题描述
哪个语义更好,, alt=""
, role="presentation"
CSS bg 图像或aria-hidden="true"
隐藏辅助技术的装饰图像?
解决方案
最好的办法是使用空白alt
文本。
<img src="squiggle.gif" width="20" height="20" alt="" />
对于 AT(辅助技术)应忽略的图像,在 img 元素上使用空 alt 文本和无标题属性。
推荐阅读
- visual-studio - 如何在 vtk 窗口中读取和显示 .csv 文件
- c++ - const 函数上的 std::function 不完整类型
- javascript - 如何编写命令行参数依赖项?
- python - 数据框到字典,按熊猫中的行
- python - 从父窗口将布局添加到另一个布局
- powershell - 谁最后使用 Powershell 查询修改了文档 (Sharepoint)
- android - 将 iOS 和 Android 应用程序转移到不同的开发者帐户 - 最终用户的商店链接是否会改变?
- symfony - 如何翻译多种语言的键索引 XLIFF 文件?
- python - 使用 *args 返回偶数
- python - 合并带有更改的 JSON 文件