Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML元素不关注tab,而是关注shift+;选项卡是可访问的_Html_Css - Fatal编程技术网

HTML元素不关注tab,而是关注shift+;选项卡是可访问的

HTML元素不关注tab,而是关注shift+;选项卡是可访问的,html,css,Html,Css,我有一个这样的结构: <div> <a href='#'>Hyperlink</a> </div> <div> <table> <tr> <td>Row1</td> <td><button>Click</button></td> </tr> <tr> &l

我有一个这样的结构:

<div> <a href='#'>Hyperlink</a> </div>
<div>
  <table>
    <tr>
      <td>Row1</td>
      <td><button>Click</button></td>
    </tr>
    <tr>
      <td>Row2</td>
      <td><button>Click</button></td>
    </tr>
    <tr>
      <td>Row3</td>
      <td><button>Click</button></td>
    </tr>
  </table>
</div>

第1行
点击
第2行
点击
第3行
点击
我无法使用tab导航到按钮,但在shift+tab上,它们获得焦点,可以访问。每个HTML元素都使用了很多类,但没有使用tabindex


问题是什么?请提供帮助。

查看HTML中的全局tabindex属性


您可以为元素指定它们应该被标记的顺序,这很可能会解决您现在遇到的任何标记焦点问题

您必须为元素定义
tabindex
,并使用一点jQuery

$(函数(){
$(“#锚定”)。单击(函数(){
$(this.html('Pres Tab now');
});
});
。隐藏{
位置:绝对位置;
顶部:-100px;
}
输入{
宽度:0px;
}

Row1Click
Row2Click
Row3Click

旋转制表符顺序需要一个虚拟输入,因为它处于隐藏模式
$(函数(){
$(“#锚定”)。单击(函数(){
$(this.html('Check Tab now');
});
});
。隐藏{
位置:绝对位置;
顶部:-100px;
}
输入{
宽度:0px;
}
a{
文字装饰:无;
颜色:#ff8800;
}

Row1Click
Row2Click
Row3Click

It's working..getting focus该问题不应与tabindex有关,因为我是通过shift+tab获得焦点的,而不仅仅是tab。@Ankita是否有与html链接的JS文件?是的。JS文件链接到HTML。你能创建一个fiddle以便很容易发现问题吗?我不想显式地提供tabindex。按钮将注意力集中在shift+tab上,而不是使用tab向前移动。我不想明确提供tabindex。您能解释一下原因吗?对于包含大量表单控件或其他元素的动态页面,使用tab index是不可行的。我面对的是这个问题的另一面,Tab从上到下都可以正常工作,但shift+Tab忽略了一些按钮
tabindex="n"