接收子元素focus_哪些HTML元素可以接收焦点?

历届女足世界杯

这里我有一个基于鲍文斯氏回答要选择任何可聚焦的HTML元素,请执行以下操作:a[href]:not([tabindex='-1']),

area[href]:not([tabindex='-1']),

input:not([disabled]):not([tabindex='-1']),

select:not([disabled]):not([tabindex='-1']),

textarea:not([disabled]):not([tabindex='-1']),

button:not([disabled]):not([tabindex='-1']),

iframe:not([tabindex='-1']),

[tabindex]:not([tabindex='-1']),

[contentEditable=true]:not([tabindex='-1'])

{

/* your CSS for focusable elements goes here */

}

或者更漂亮一点:a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),

iframe,[tabindex],[contentEditable=true]{

&:not([tabindex='-1'])

{

/* your SCSS for focusable elements goes here */

}}

我增加了它作为一个答案,因为这是,我正在寻找的,当谷歌重定向我到这个堆栈溢出的问题。

编辑:还有一个可聚焦的选择器:[contentEditable=true]

然而,这是很少使用的。

Copyright © 2088 世界杯女足_足球歌曲世界杯主题曲 - luxiuying.com All Rights Reserved.
友情链接