gpt4 book ai didi

html - Tab 顺序跳转到 tabindex 0 之后的 URL

转载 作者:可可西里 更新时间:2023-11-01 13:46:47 24 4
gpt4 key购买 nike

我对 taborder 有疑问。在一个网页中,我有带有自定义 tabindex 的元素,tab 顺序在 tabindex 0 之后跳转到 url,然后返回到 tabindex 1。我怎样才能限制 taborer 去 URL。任何人都可以知道为什么会发生这种情况。

谢谢。

最佳答案

您应该从 tabindex="1" 开始。

tabindex="1" (or any number greater than 1) defines an explicit tab order. This is almost always a bad idea.

tabindex="0" allows elements besides links and form elements to receive keyboard focus. It does not change the tab order, but places the element in the logical navigation flow, as if it were a link on the page.

注意事项:

In theory, tabindex should only be used in cases where:

  • The default tab order is not ideal, AND
  • The tab order cannot be changed by rearranging items in the content and/or by altering the style sheet to reflect the best visual arrangement.

来源:http://webaim.org/techniques/keyboard/tabindex

关于html - Tab 顺序跳转到 tabindex 0 之后的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41295692/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com