Colors 已访问链接正在更改悬停的颜色
我真的很困惑。。。我有以下代码:Colors 已访问链接正在更改悬停的颜色,colors,hyperlink,hover,visited,Colors,Hyperlink,Hover,Visited,我真的很困惑。。。我有以下代码: a { float: left; padding: 5px 20px; } a:link { text-decoration: none; color: #008B45; } a:hover { color: #00FF00; font-weight: bold; } a:visited { color: #EE9A00; } 但是我访问后的链接a链接的颜色没有改
a {
float: left;
padding: 5px 20px;
}
a:link {
text-decoration: none;
color: #008B45;
}
a:hover {
color: #00FF00;
font-weight: bold;
}
a:visited {
color: #EE9A00;
}
但是我访问后的链接a链接的颜色没有改变,根据a:悬停。。。为什么?
谢谢我不知道确切的原因,但我想这是因为属性:visted比:hover更可取。为了实现这一点,您必须在颜色声明的末尾添加“!important”。像这样:
a {
float: left;
padding: 5px 20px;
}
a:link {
text-decoration: none;
color: #008B45;
}
a:hover {
color: #00FF00 !important;
font-weight: bold;
}
a:visited {
color: #EE9A00;
}