Reputation: 73
I have used a:visited
CSS for my web application, but the browser remember its history for unlimited time.
How can I set this time till the browser is closed?
Upvotes: 0
Views: 327
Reputation: 96325
That is a browser setting, nothing you can influence with CSS.
Alternatives:
Make the links “different” for each browsing session, f.e. by appending a random GET parameter/query string value, or
do not use :visited
in the first place, but keep track of clicked links via JavaScript and sessionStorage or a cookie, and then set a class on those elements every time a page is loaded, to achieve the formatting you want for that state.
Upvotes: 2
Reputation: 943615
You can't. How long a browser keeps a URL in its history is entirely up to the browser and there are no APIs that allow a website to influence it.
Upvotes: 0