How to CSS active element Selector :active
Description
The :active
selector matches activating elements.
The :active
selector isn't limited to
elements with which the user can interact.
Example
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
<style type="text/css">
:active { <!--from ww w. j a va2s.c om-->
border: thin black solid;
padding: 4px;
}
</style>
</head>
<body>
<a href="http://java2s.com">Visit the java2s.com</a>
<p>I like <span>HTML</span> and CSS.</p>
<button>Hello</button>
</body>
</html>
The code above generates the following result.