:focus 和 :active 有什么区别? [英] What is the difference between :focus and :active?

查看:18
本文介绍了:focus 和 :active 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

:focus:active 伪类有什么区别?

What is the difference between the :focus and :active pseudo-classes?

推荐答案

:focus:active 是两种不同的状态.

:focus and :active are two different states.

  • :focus 表示当前选择元素接收输入时的状态,
  • :active 表示元素当前被用户激活时的状态.
  • :focus represents the state when the element is currently selected to receive input and
  • :active represents the state when the element is currently being activated by the user.

例如,假设我们有一个 <button>.<button> 将没有任何状态开始.它只是存在.如果我们使用 Tab 将焦点"赋予

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆