← Back to pseudo-classes

CSS Pseudo-class / Element

:active

User Action

Applies styles while an element is being activated, such as when a button is pressed.

Syntax

selector:active { }

Example

button:active { transform: scale(0.97); }

Common use cases

  • Press feedback on buttons
  • Click animations
  • Visual confirmation of interaction

Practical developer insight

:active fires during the click — combine with :hover for a complete interactive state. Note: :active is very short-lived and may behave differently on touch devices depending on the browser.

Related