CSS | :visited Selector
The :visited selector in CSS is used to select the visited links. For example, visit some link on website and again see it, then it will find changed color of that link. This change in color is done by :visited selector.
The allowed CSS property of :visited selectors are listed below:
- color
- border-color
- background-color
- outline color
- column-rule-color
- fill-color and stroke
Syntax:
:visited {
// CSS Properties
}
Example:
<!-- HTML code to illustrate :visited selectors --><!DOCTYPE html> <html> <head> <title>:visited selector</title> <style> /* visited CSS property */ a:visited { color: green; } </style> </head> <body style = "text-align:center"> <h1> :visited Selector </h1> <h3> Click on the link </h3> <p> Visit Geeks: target = "_blank">geeksforgeeks.org</a> </p> </body> </html> |
chevron_right
filter_none
Output:

Recommended Posts:
- Maximum number of leaf nodes that can be visited within the given budget
- CSS | #id Selector
- CSS | * Selector
- CSS | ::before selector
- CSS | ::after Selector
- CSS | :not Selector
- CSS | ::first-line Selector
- CSS | :focus Selector
- CSS | :indeterminate Selector
- CSS | [attribute$=value] Selector
- CSS | :nth-last-child() Selector
- CSS | :nth-child() Selector
- CSS | :link Selector
- CSS | :last-of-type Selector
- CSS | Class Selector
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



