pantech
pantech

Reputation: 69

Changing hyperlink's color to visited and revert it back after refresh

suppose I have a link with say blue color. When I click it its turned to red by a:visited property in css. Now even if I refresh the original page where the link was originaly present then also I am getting the color of a link as visited. I know that this is because :visited works on the basis of browsers history. Is there any other method by which the visited links color can be revert back as unvisited after refreshing the page.

Upvotes: 1

Views: 4276

Answers (1)

James
James

Reputation: 67

I believe you have to clear your cache for the link to go back to normal.

Edit: If you want it to go back to default color after refresh, then is there really a reason why the color has to change in the first place? Why not just set the visited color to whatever the normal color is so it doesn't change color(where 999999 is default color):

a:visited{ 
    color:#999999;
}

Upvotes: 1

Related Questions