本文介绍了如何获得-moz-user-focus:忽略工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的理解是,当使用 -moz-user-focus:ignore
(),Firefox应该在跳格时跳过该元素。但是,请尝试:
<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Strict // EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = utf-8/>
< / head>
< body>
< form action =/>
< input type =textvalue =First>
< input type =textvalue =Secondstyle = - moz-user-focus:ignore>
< input type =textvalue =Third>
< / form>
< / body>
< / html>
- 第一次点击标签:您位于第一个文本字段。
- 第二次点击标签:即使在
-moz-user-focus:ignore
。我在这里丢失了什么? ://bugzilla.mozilla.org/show_bug.cgi?id=379939rel =nofollow noreferrer> bug覆盖了这个在Mozilla的bug基地。在修正这个错误之前,我们可以使用 - Hit tab a first time: you're on the first text field.
- Hit tab a second time: you're on the second text field, despite the
-moz-user-focus: ignore
. Am I missing something here?
tabindex = - 1
来代替CSS。 My understanding is that when using -moz-user-focus: ignore
(see doc) on an element, Firefox should skip that element when tabbing. However, try:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<form action="/">
<input type="text" value="First">
<input type="text" value="Second" style="-moz-user-focus: ignore">
<input type="text" value="Third">
</form>
</body>
</html>
解决方案
It seems there is a bug covering this in the Mozilla bug base. Until this bug is fixed, we can use tabindex="-1"
instead of CSS as a workaround.
这篇关于如何获得-moz-user-focus:忽略工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!