CSS :visited Selector
Example
/* set color to red for visited links */
a:visited {
color: red;
}
Meaning
The :visited selector specifies the link after being pressed.
Note: For privacy reasons, the styles that can be modified using this selector are very limited.
Allowed styles:
- color
- background-color
- border-color
- outline color
- column-rule-color
- SVG related the color parts of fill and stroke
Version: CSS1
Standard Syntax
:visited {
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;
}