0

Is there a :hover selector that can be used when an 'a' tag is clicked it causes it to change color and then turns back when the click is released?

Any help is much appreciated. :D

Wowsk
  • 3,637
  • 2
  • 18
  • 29
  • Possible duplicate of [Can I have an onclick effect in CSS?](http://stackoverflow.com/questions/13630229/can-i-have-an-onclick-effect-in-css) –  Apr 26 '16 at 11:02

2 Answers2

3

Use :active selector, this is used to select the active element, in this case the a element.

a:active{
  color:purple;
}
<a>Click Me</a>
Wowsk
  • 3,637
  • 2
  • 18
  • 29
0

try this one too

https://jsfiddle.net/kLju23fx/2/

<code>
a:hover {
    color: hotpink;
}
a:active {
    color: blue;
}
a:link {
    color: red;
}
a:visited {
    color: green;
}
</code>
Atula
  • 2,177
  • 2
  • 12
  • 28