Wolfgang Hall
Wolfgang Hall

Reputation: 97

Visited Links in CSS

I'm currently building my first site and I am having trouble with the coloration of visited links. They currently turn purple after they've been visited. How do I change this function? Here is my current code:

a:link {
    text-decoration: none;
}

a:visited {
    text-decoration: none;
}

a:hover {
    background-color: none; 
}

Upvotes: 0

Views: 95

Answers (3)

Muhammad
Muhammad

Reputation: 7344

To prevent the default behavior of changing the color into purple you have to override the a:visited color as following.

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

Upvotes: 1

l0xluzzy
l0xluzzy

Reputation: 51

Try this

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

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

Upvotes: 0

Ash
Ash

Reputation: 2605

As per the suggestion already made, something like:

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

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

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

Upvotes: 1

Related Questions