3

I'm completely stumped on this one - I have a pretty basic document with an ordered list containing anchors and hidden divs that show when a link is clicked. The problem is when one link is clicked all links change colour as per the a:visited css rule. This does not happen in IE10 (only the visited link changes colour as expected) but it does happen in Opera, Chrome and Firefox.

Here's the markup: http://jsbin.com/usUwecE/3/edit - I'm pretty new to web design so it could be something really obvious, but any help would be appreciated. Cheers!

4

3 回答 3

3

那是因为它们都指向同一个 URL,所以当您单击一个 URL 时,它们都会返回它们已被访问过。

于 2013-08-26T11:26:24.417 回答
0

正如everydayghost所说,所有href属性都指向#javascript:; 这是地址中的同一页。为了改变这一点,您必须使每个 href 都是唯一的,即。href="#div1", href="#div2" ...

于 2013-08-26T11:39:51.650 回答
0

删除哈希
而不是在您的代码中#javascript:;使用javascript:;

于 2013-08-26T11:28:08.847 回答