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