访问CSS中的链接

时间:2015-11-02 01:13:00

标签: html css

我目前正在构建我的第一个网站,而我在访问链接的着色方面遇到了麻烦。他们目前在访问后变成了紫色。我该如何更改此功能?这是我目前的代码:

a:link {
    text-decoration: none;
}

a:visited {
    text-decoration: none;
}

a:hover {
    background-color: none; 
}

3 个答案:

答案 0 :(得分:1)

根据已经提出的建议,例如:

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

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

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

答案 1 :(得分:1)

要防止将颜色更改为紫色的默认行为,您必须覆盖a:visited颜色,如下所示。

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

答案 2 :(得分:0)

试试这个

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

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

相关问题