锚重访在xhtml中盘旋

时间:2014-06-14 18:19:48

标签: html css xhtml

这是我的链接代码。每当我访问链接时,每当我回到页面并且将鼠标悬停在页面上时,我希望我的链接为白色。出于某种原因,只要我将鼠标悬停在它上面,它就会变为黑色。 />

a:link {    
   font-size: 18px;                              
   background-color: none;
   color: #000000;
   text-decoration: none;
}
a:hover {
   background-color: #1E425A;
   color: white;
   text-decoration: none;
   font-weight: bold;
   padding-left: 3px;
   padding-right: 3px;
}
a:visited {
   background-color: none;
   color: #000000;
   text-decoration: none;
}
a:active {
   background-color: blue;
}

2 个答案:

答案 0 :(得分:0)

具有相同特异性的CSS规则集按顺序应用

如果您希望:hover规则覆盖:visited规则,请在 :hover规则集后移动:visited规则集

答案 1 :(得分:0)

这应该覆盖您的visited规则

a:link{
font-size: 18px;                              
background-color:none;
color:#000000;
text-decoration:none;
}
a:visited{
background-color:none;
color:#000000;
text-decoration:none;
}
a:hover{
background-color: #1E425A;
color:white;
text-decoration:none;
font-weight:bold;
padding-left: 3px;
padding-right: 3px;
}
a:active{
background-color: blue;
}