accesskey快捷键_创建用于站点导航的Accesskey快捷方式

accesskey快捷键

One of the principles of is that making websites accessible benefits everyone, not only people with differing abilities. In the past, I’ve used the accesskey attribute to enhance forms, but relatively few web developers appreciate that accesskey can also be used on tags other than <label>, most especially links, in a way that benefits both experienced users and those requiring keyboard shortcuts.

的原则之一是,使网站可访问使所有人受益,而不仅仅是具有不同能力的人。 过去,我曾使用accesskey属性来增强表单 ,但很少有Web开发人员意识到accesskey还可以用于除<label>以外的其他<label> ,尤其是链接,从而使有经验的用户和需要键盘快捷键。

There is a loose standard for accesskey values for site site ; 1 is generally used for the Home page, 3 for Site map, 4 for search, 0 for help, etc. These can be added directly to <a> tags in navigation:

站点 accesskey值有一个宽松的标准; 1通常用于主页, 3用于站点地图, 4用于搜索, 0用于帮助,等等。这些可以直接添加到导航中的<a>标记中:

<nav role="navigation">
	<a href="index.html" accesskey="1">Home</a>
	<a href="about.html" accesskey="2">About</a>
	<a href="map.html" accesskey="3">Site Map</a>
	<a href="search.html" accesskey="4">Search</a>
	<a href="help.html" accesskey="0">Help</a>
</nav>

The keyboard combos for accesskey shortcuts differ slightly across browsers and platforms:

在不同的浏览器和平台上,用于快捷键快捷键的键盘组合略有不同:

Accesskey Keyboard Modifiers For Different Browsers
BrowserOperating SystemExample
Internet Explorer / Chrome / SafariWindowsAlt + 0
FirefoxWindowsAlt + SHIFT + 0
Firefox / SafariMacCtrl + 0
ChromeMacCtrl + Opt + 0
适用于不同浏览器的Accesskey键盘修饰符
浏览器 操作系统
Internet Explorer / Chrome / Safari 视窗 Alt + 0
火狐浏览器 视窗 Alt + Shift + 0
火狐浏览器 苹果电脑 Ctrl + 0
Chrome 苹果电脑 Ctrl + Opt + 0

I’ve added access keys on the site you’re reading now; feel free to try them out.

我已经在您正在阅读的网站上添加了访问密钥; 随时尝试。

Accesskeys for The New Code
KeyFunction
1Home page
SFocus cursor in search input
4Initiate search
0About
. (period)Go to next page
, (comma)Go to previous page
新密码的快捷键
功能
1个 主页
小号 将光标放在搜索输入中
4 开始搜寻
0 关于
(期) 转到下一页
(逗号) 转到上一页

Two final points of note:

最后两点注意事项:

  • accesskey values must be unique on the page in which they are used; as navigation will still be present on a form page, this means greater restrictions on which accesskey values are available for form elements.

    accesskey值在使用它们的页面上必须是唯一的; 作为导航仍然将存在一个形式页面上,这意味着更大的限制在其上accesskey值可用于表单元素。

    Ideally accesskey values should be visually indicated in the navigation, using the same CSS techniques you would use for form labels.

    理想情况下,应该使用与表单标签相同CSS技术在导航中直观地指示accesskey值。

更多资源 (More resources)

As I mentioned, for websites has not yet gained the same level of appreciation or structure as HTML5 or other W3C standards, although adoption is increasing, albeit very slowly. There are several recommended resources:

正如我提到的那样,尽管可访问性的增长速度非常缓慢,但其尚未达到与HTML5或其他W3C标准相同的赞赏或结构。 有几种推荐的资源:

WebAIM (Web Accessibility In Mind) is the leader in promoting web accessibility standards. Their WAVE (Web Accessibility eValuation Tool) is one of the best for “validating” the accessibility of a web page.

WebAIM (头脑中的Web Accessibility)是促进Web Accessibility标准的领导者。 他们的WAVE (网络可访问性评估工具)是“验证”网页可访问性的最佳工具之一。

Broadly speaking the EU has been ahead of the rest of the world in supporting web accessibility standards, officially adopting the W3C's Web Content Accessibility Guidelines 1.0 as the standard that all government pages should meet.

从广义上讲,欧盟在支持Web无障碍标准方面一直领先于世界其他地区,正式采用了W3C的Web Content Accessibility Guidelines 1.0作为所有政府页面都应满足的标准。

At a practical level, the W3C is developing WAI 2.0 standards (Web Accessibility Initiative). More (rather technical) information can be found on the WAI site.

在实践上,W3C正在开发WAI 2.0标准(Web Accessibility Initiative)。 可以在WAI网站上找到更多(技术性的)信息。

翻译自: https://thenewcode.com/189/Creating-Accesskey-Shortcuts-For-Site-Navigation

accesskey快捷键

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值