The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › CSS – change Text/background color with onclick!!!
Hello friends, I want to know, if it’s possible to change the color(Text/background color) of a certain class of text when you click a link “without JavaScript”. If “YES”, How?
Hi Fourize, very cool,,,, thanks :-)
but can I make it purely with CSS and work on FF and IE?
Depending on your actual needs, you can use the CSS pseudo class active to simulate “onclick”.
a {color: red} a:active {color: blue} /* When clicked (or clicked and held) the color will be blue */