When is: visited pseudo-class applied to hyperlink

I have some questions about the pseudo class :visited:

  • Based on what browsers decide when the pseudo-class :visitedshould be applied to the hyperlink?
  • Do they take this information from the history of the browser pages or stored in a session or somewhere else?
  • Is it possible (for a web page developer) to control how long a pseudo-class :visitedshould apply to hyperlinks?

(Note: I'm not trying to solve the real problem, I'm just wondering how this works)

+3
source share
6 answers

, . . , "-".

+5

( , - ).

, , :visited. , , .

+2

: visited .

-? , , .

, , :

http://www.yourdomain.com/?<random argument>

, , .

@edit , , cookie, , cookie ( ), > , ,

+1

, , . , , , , , , .

+1

and almost everything was covered except for one. when is it applied? when the landing page has an onload event. so not right away. if you open the link in a new tab in the backgorund, you will see some delay before it switches its style. tahts is exactly the time that the external page loads to load, and so that the browser saves history / starts the change.

+1
source

It applies only to hyperlinks ( <a href>) and when an entry is found in the browser history (not the session).

0
source

Source: https://habr.com/ru/post/1762139/


All Articles