首页 > 解决方案 > 我在同一个位置有多个链接(到同一个 href 链接)。a:visited 在单击时会全部更改。我可以把每个分开吗?

问题描述

我尝试使用一个类,也尝试为每个链接使用唯一的类,但我仍然让所有链接“访问”,只有一个被点击。我想知道是否有办法让每个“访问”都唯一,即使一个 href 去同一个地方。太感谢了。

a.bluelist:link{
  color:#00a9ff; 
}

a.bluelist:hover{
color: #4dc3ff;
}

a.bluelist:visited{
color: #b99aff;
}

/*next option I tried is to change and make classes unique*/

a.bluelist1:link{
  color:#00a9ff; 
}

a.bluelist1:hover{
color: #4dc3ff;
}

a.bluelist1:visited{
color: #b99aff;
}

a.bluelist2:link{
  color:#00a9ff; 
}

a.bluelist2:hover{
color: #4dc3ff;
}

a.bluelist2:visited{
color: #b99aff;
}

a.bluelist3:link{
  color:#00a9ff; 
}

a.bluelist3:hover{
color: #4dc3ff;
}

a.bluelist3:visited{
color: #b99aff;
}

a.bluelist4:link{
  color:#00a9ff; 
}

a.bluelist4:hover{
color: #4dc3ff;
}

a.bluelist4:visited{
color: #b99aff;
}
<a href="#gohere" class="bluelist">Text1</a>     
<br>

<a href="#gohere" class="bluelist">Text2</a>     
<br>
<a href="#gohere" class="bluelist">Text3</a>     
<br>
<a href="#goelsewhere" class="bluelist">Text4</a>   
<br>

/*Next option I tried is here*/

<a href="#gohere" class="bluelist1">Text1</a>    
<br>
<a href="#gohere" class="bluelist2">Text2</a>    
<br>
<a href="#gohere" class="bluelist3">Text3</a>    
<br>
<a href="#goelsewhere" class="bluelist4">Text4</a>  

标签: csshovervisited

解决方案


推荐阅读