Is it possible to let :after pseudo element get focus when press tab

后端 未结 1 394
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-19 18:37

I have one h1 element, which has a :after pseudo element, when firstly press tab, this h1 element will get focus, but when I press tab again, the focus will go to next REAL

相关标签:
1条回答
  • 2020-12-19 19:26

    The ::before and ::after pseudo-elements are not focusable.

    If you absolutely need this box to be focusable you will have to make it a real element, possibly inserted using JS if you don't feel comfortable polluting your markup.

    0 讨论(0)
提交回复
热议问题