pseudo-class

:active — CSS reference

Matches an element during activation, commonly while a pointer button is held down. It is not a persistent selected state. Preserve focus indication for keyboard users.

Formal Syntax & Structure

css syntaxcss
:active

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a,#b {color:#202020} #a:active {color:#006050}</style><body><button id="a">Press</button><button id="b">Other</button></body></html>
CSS Reference