I used the a:visited
pseudo-class in CSS. The problem is when I refresh the page, the links still stays red, so they do not become "unvisited", that is to say blue again. Is that normal? Can I do something about it?
0
votes
You could try clearing the browser history.
- Roland Starke
Possible duplicate of How long will a browser remember a "a:visited" link?
- Ivar
if link visit is stored in history it'll be visited as long as it's in your browsers histoy
- NoOorZ24
in most cases it makes sense to only check for active not visited
- NoOorZ24
@Dragonthoughts I don't really see how this question is going to benefit from an MCVE.
- Ivar
1 Answers
1
votes
First of all: Welcome!
The :visited
pseudo class marks every link that has been visited in the browsing history of the user. That means, that even after you reload the page the link stays "visited". An example is the google search, where visited links are purple. They only change back when clearing the browsing history.
This might not help you, since you didn't give any details regarding your environment but you could try to use the :active
or :focus
pseudo classes.