2015-11-02 46 views
0

我目前正在構建我的第一個網站,並且遇到訪問鏈接着色的問題。他們在訪問後目前變成紫色。我該如何改變這個功能?這裏是我當前的代碼:在CSS中訪問過的鏈接

a:link { 
    text-decoration: none; 
} 

a:visited { 
    text-decoration: none; 
} 

a:hover { 
    background-color: none; 
} 
+1

什麼'color'? –

+1

如果您設置了「顏色」,則可以覆蓋默認設置。 – sideroxylon

回答

1

爲了阻止默認行爲將顏色更改爲紫色,則必須覆蓋a:visited顏色如下。

a{ 
 
    text-decoration: none; 
 
} 
 
a:visited { 
 
    text-decoration: none; 
 
    color: blue; 
 
}
<a href="/">Visited</a>

1

按照已提出的建議,是這樣的:

a:link { 
    text-decoration: none; 
    color: blue; 
} 

a:visited { 
    text-decoration: none; 
    color: blue; 
} 

a:hover { 
    background-color: none; 
    color: blue; 
} 
0

試試這個

a:visited { 
 
    text-decoration: none; 
 
    color: black; 
 
    } 
 

 
a { 
 
    text-decoration: none; 
 
    color: black; 
 
    }
<a href="#"> Link </a>