:active (CSS selector)

Spec
Version
CSS1
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+ CH2+
Buggy Full Full Full Full

Syntax

:active {
declaration block
}

Description

This pseudo-class matches any element that’s in the process of being activated. It would apply, for instance, for the duration of a mouse-click on a link, from the point at which the mouse button’s pressed down until the point at which it’s released again. The pseudo-class does not signify a link to the active, or current, page—that’s a common misconception among CSS beginners.

Example

This rule will set the font color of an active HTML link to #cccccc:

a:active {
  color: #cccccc;
}

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Buggy Buggy Buggy Buggy Full Full Full Full Full Full Full Full Full Full Full Full Full

Internet Explorer 5.5 and 6 incorrectly apply this pseudo-class to links that have keyboard input focus—a state that should be matched by :focus, which those browsers do not support.

Internet Explorer versions up to and including 7:

  • Apply :active only to HTML a elements that have an href attribute.
  • Ignore :active unless it’s the last part of a pseudo-class chain.

In Internet Explorer version 8 the manipulation of elements with negative z-index is buggy when used in conjunction with :hover or :active rules (source James Hopkins).

User-contributed notes

Related Products