Skip to main content
D
CSS
CSS Links

CSS Links

CSS styles clickable anchor links in different states.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

CSS targets anchor tags to change how links look. Because users interact with links, CSS provides pseudo-classes to style them when hovered, clicked, or previously visited. This gives users visual feedback while navigating.

Example

Example
1/* this styles links */
2a:link { color: blue; }
3a:visited { color: purple; }
4a:hover { color: red; }
5a:active { color: yellow; }

Key Points

  • The `:link` pseudo-class styles unvisited links.
  • The `:visited` pseudo-class styles clicked links.
  • The `:hover` pseudo-class triggers when the mouse is over the link.
  • The `:active` pseudo-class triggers during the exact moment of a click.

Up Next

Continue your journey with the next topic.

Go to CSS Lists