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快捷方式。
accesskey