Reputation: 67
Is there a way to set a:visited for anchors on the same page?
What happens now is that whatever style I apply to a:visited goes for all the links before I even click. What I need is maybe something like a:clicked instead of visited, or some way to highlight the last link clicked, but I don't know of anything like that.
Is there anything I can do that does not require js?
thanks!
Upvotes: 1
Views: 287
Reputation: 3
Set a different class for each anchor.
a.first:visited {}
a.other:visited {}
Upvotes: 0
Reputation: 34147
What happens now is that whatever style I apply to a:visited goes for all the links before I even click.
May be all your links have same href
These should work
a {
color: red;
}
a:visited {
color: blue;
}
a:hover {
color: yellow;
}
Upvotes: 0
Reputation: 65
To set different colours for your links you could go
#header a:visited {
}
# nav a:visited {
}
Or using a span with a class for each colour
Upvotes: 2