Windows Dev Center

:active pseudo-class

Sets the style of an element when it is engaged or active.

CSS 2.1, Section 5.11.3

 

Syntax

selector :active {...}

Parameters

selector

A CSS simple selector

Standards information

Remarks

The default value of the :active pseudo-class is browser-specific.

The :active pseudo-class is often used with :hover, :link, and :visited, the pseudo-classes that affect the other states of a link.

"Active" means that an element has been activated, and some action is being performed but is not yet complete.

The :active pseudo-class is most often used with the a element but it applies to all pseudo-elements.

Examples

The following style rule uses the :active pseudo-class to set the font-weight and color attributes of an active link in a document.


<style>
    A:active { font-weight:bold; color:purple }
</style>

 

 

Show:
© 2015 Microsoft