Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide a link if it was visited?

Tags:

html

jquery

css

I would like to remove a link from a page when it was visited. But...how, if the pseudo-class :visited have privacy restrictions? (i can not use display: none, for example)

(How i would like to do) Example:

.someclass a:link {display:block;}

.someclass a:visited {display:none;}

Thanks guys.

Detail: i'll use a external link too, so i can not use jquery cookies or localstore, and the links will be delivered by email, therefore i can not use jquery on click in the class "X".

like image 927
Iago Avatar asked Feb 06 '14 17:02

Iago


1 Answers

The only attribute you can change via the :visited pseudo-class is the color. This is in response to a security issue where javascript could be used to measure the computed style of a link and determine if the user had visited that url. This has been patched in the recent years, so you should avoid relying on it for functionality like you are desiring. See the article here for a more detailed description:

http://www.impressivewebs.com/styling-visited-links/

like image 135
Jeff Cashion PhD Avatar answered Sep 30 '22 20:09

Jeff Cashion PhD