Copyright © tutorialspoint.com

CSS Pseudo-class :active

previous next


Description:

The :active pseudo-class is used to add special effect to an activated element.

While defining pseudo-classes in a <style>...</style> block, following points should be taken care:

Possible Values:

Applies to:

Anchor / Link element.

Example:

Following is the example which demonstrates how to use :active class to change the color of active links.

<style type="text/css">
a:active {color: #FF00CC}
</style>
<a href="/html/index.htm">Click This Link</a>

This will produce following link. This will change its color to pink when user clicks it.

Click This Link

To Become more comfortable - Do Online Practice


previous next

Copyright © tutorialspoint.com