如何访问未访问的链接?

时间:2015-06-09 11:17:00

标签: html5 css3

访问链接的问题没有变成他们应该的颜色。应该是什么,链接是黑色的,70%的不透明度。当您将鼠标悬停在它上面时,它应该更改为100%不透明度的aliceblue。这仅适用于未访问的链接。访问链接应该和普通链接完全相同,除了它们没有正确改变的事实。

a{
transition: color 1s ease;
}

a:link {
display: inline-block;
margin-left: 20px;
color: rgba(0,0,0,0.7);
font-weight: 700;
font-size: 14px;
text-decoration: none;
font-family: arial;
text-transform: uppercase;
}

a:hover{
color: aliceblue;
text-decoration: none;
font-family: arial;
text-transform: uppercase;
}

a:visited{
transition: color 1s ease;
display: inline-block;
color: rgba(0,0,0,0.7);
margin-left: 20px;
font-weight: 700;
font-size: 14px;
text-decoration: none;
font-family: arial;
text-transform: uppercase;
}

1 个答案:

答案 0 :(得分:0)

这是CSS中级联样式的问题,如下所述:

https://stackoverflow.com/a/1536822/3990818

  

a:hover必须放在a:linka:visited规则

之后

除非完成此操作,否则a:visited将覆盖a:hover

您也可以通过重新排列不同的CSS规则在http://www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_link_more1进行试验,作为此问题的简单试验场。

相关问题