【问题标题】:Visited link is changing the color of hover访问过的链接正在改变悬停的颜色
【发布时间】:2013-08-03 12:28:21
【问题描述】:

我真的很困惑...我有这个代码:

    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改变颜色:悬停...为什么?

谢谢

【问题讨论】:

    标签: colors hyperlink hover visited


    【解决方案1】:

    我不知道具体原因,但我想这是因为属性 :visited 优于 :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; 
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-05
      • 2012-01-19
      • 2010-10-11
      • 2016-05-01
      • 1970-01-01
      相关资源
      最近更新 更多