CSS :link Selector

❮ Previous Selectors Next ❯

Example

a:link { 
  background-color: green;
}

Meaning

The :link selector specifies the unvisited link.

It matches every unvisited <a> or <area> element that has an href attribute.

Note: Use :any-link to select an element independent of whether it has been visited or not.

Version: CSS1




Standard Syntax

:link {
  css declarations;
}



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







More Example

Styling unvisited, visited, hover, and active links:

Example

/* unvisited link */
a:link {
  color: red;
}

/* visited link */
a:visited {
  color: yellow;
}

/* mouse over link */
a:hover {
  color: black;
}

/* selected link */
a:active {
  color: pink;
}
❮ Previous Selectors Next ❯