CSS provides powerful styling options for HTML links (<a> tags) to improve appearance, usability, and interactivity. You can customize link colors, add hover effects, remove underlines, and more.
A link (<a>) has four states that can be styled using CSS:
| Selector | Description | Example |
|---|---|---|
a:link |
Styles a normal, unvisited link. | a:link { color: blue; } |
a:visited |
Styles a link that has been visited. | a:visited { color: purple; } |
a:hover |
Styles a link when the user hovers over it. | a:hover { color: red; } |
a:active |
Styles a link when it is clicked. | a:active { color: green; } |
a {
color: blue; /* Default link color */
text-decoration: none; /* Removes underline */
}