Little Web Hut
(Cascading Style Sheets) CSS 2.1 Reference

CSS Pseudo-class :active Selector

 

What is a CSS Pseudo-class :active Selector?

  • The :active pseudo-class selector specifies elements that are being activated. An element can be activated, for example, by pressing the mouse button while hovering over the element. When the mouse button is released, the element is no longer activated. In the following example, the color property will be set to red for any active <p> element.
CSS Example:
  p:active {color: red;}
  <p>The red style is applied when the mouse button is pressed while hovering over this element.</p>
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style