...

/

Link and URL Pseudo-Classes

Link and URL Pseudo-Classes

Learn to style and interact with links and URLs using powerful pseudo-classes for dynamic web experiences.

Link and URL pseudo-classes allow us to style hyperlinks based on their state, such as whether they've been visited or are currently active. They also enable us to style elements targeted by URL fragments.

:link and :visited

The :link applies to unvisited links, while the :visited applies to links the user has already visited.

Applying style to visited and unvisited links

The above CSS code styles unvisited links in blue, while styles the visited links in gray.

:hover, :active, and :focus on links

These pseudo-classes hover, active, and focus are often used with ...