문제

For the following CSS:

a:link {color: blue; text-decoration:underline;}
a:visited {color: red; text-decoration:none;}
a:hover {color: red; text-decoration:none;}
a:active {color: red; text-decoration:none;}

The visited state changes to a red font, but the underline does not go away. It seems to be over-written by the a:link definition for text-decoration.

Currently, the only way to ensure that the visited state has no underline is by giving all states no underline as well. It must be something new because in the past, this CSS worked. Is there any way to set the a:link to underline and the a:visited to not underline?

도움이 되었습니까?

해결책

I believe browsers have implemented this as a security measure. Previously one could style visited links differently and people used this to find out which sites a visitor had visited. They simply listed thousands of popular URLs on a site (hidden most likely) and checked with JS which ones were styled differently than others. This way the site owner could know which sites his visitors frequent.

다른 팁

You must do same text-decoration of all links...

Alternative text-decoration doesnot work

Here is demo : http://phihag.de/2011/so/visited.html

Good Luck !

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top