accesskey_Firefox Accesskey错误修复

accesskey

Firefox has a known issue with using the numeral 1 as an access key shortcut, a bug that has been present through several versions of the browser. Essentially Firefox sees the 1 key as being shifted when it is used. As accesskey 1 is usually reserved for the home / index page, the solution is to create an alternate accesskey link to the home page with the exclamation point (i.e. a shifted 1) as the shortcut. This is easy, as the home page is usually linked to at least twice on every page: once in the navigation bar, and once in the <h1> element. An example would be:

Firefox在使用数字1作为访问键快捷方式方面存在一个已知问题,该错误已在多个版本的浏览器中出现。 本质上,Firefox在使用时将1键视为已移动。 由于访问键1通常是为主页/索引页保留的,因此解决方案是使用感叹号(即Shifted 1 )作为快捷方式来创建指向主页的备用访问键链接。 这很容易,因为主页通常在每个页面上至少链接两次:一次在导航栏中,一次在<h1>元素中。 一个例子是:

<h1><a href="index.html" accesskey="!">Brobdingnagian Corporation</a></h1>
<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>

Firefox will interpret any use of the 1 key as an exclamation point, and use the accesskey attribute in the link around the h1 content; all other browsers will use the normal 1 shortcut provided by the link in the unordered list.

Firefox会将对1键的任何使用解释为感叹号,并在h1内容周围的链接中使用accesskey属性; 所有其他浏览器将使用无序列表中的链接提供的常规1快捷方式。

翻译自: https://thenewcode.com/192/Firefox-Accesskey-Bug-Fix

accesskey

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值