The :active pseudo-class applies while an element is being activated (e.g. clicked) by the user. For example, between the times the user presses the mouse button and releases it.
Example – css :active
This example reduces font-size to 0.9em when a link gets clicked. Note that click does not reload the page as we are adding hash fragment in url.
<style type="text/css"> a:active { font-size: 0.9em; } </style> <a href="#target1">Click me</a><br/>
Related
- CSS pseudo class :link - style for unvisited links
- CSS pseudo class :visited - style for visited links
- CSS pseudo class :hover
- CSS pseudo class :focus