CSS Selector Level 1 » User action pseudo-class

This user action pseudo-class will match elements which are activated by a user, this could happen between the user clicked/activated a button and release this action then.

Syntax

Copy
:active {
    /* declarations */
}

Example

Copy
button:active {
    background-color: pink;
}

In this example will the <button> get a pink background if the user clicks and holds it.

Try example in CodePen

Browser support

Platform Chrome Firefox Safari Edge Internet Explorer Opera
Desktop Yes (1.0) Yes (1.0) Yes (1.0) Yes (12.0) Yes (3.0) Yes (7.0)
Mobile Yes (1.0) Yes (1.0) Yes (1.0) Yes (12.0) Yes (3.0) Yes (7.0)

Please wait a moment, the comments start loading now...
explorermozillachromesafariopera