In CSS, you have 4 available properties to define the states of hyperlinks.
Property Name | Description | Example |
a:active | A link will become active when you click on the link. |
a:active {color:yellow} |
a:link | Apply to all links that are not visited yet |
a:link {text-decoration:none;} |
a:visited | Apply to links that have been clicked or visited. |
a:visited {color:red} |
a:hover | Apply the action, when you hover your mouse over the links. |
a:hover {text-decoration:underline;} |
Examples
Please see the following quick examples on how each link state is used.
CSS Style | Result |
a:link{ color:blue; text-decoration:none; font-weight:normal; } a:hover{ color:red; text-decoration:underline; } a:visited{ text-decoration:underline; color:green; } a:active{ font-weight:bold; color:#black; } |
Click here |