So I have a div I want to change the color of when clicked. I have three divs over all and I want to denote which one is the active div when clicking on it
Basically
div:focus {
background-color:'color';
}
Try this, it worked for me:
div:active{
background-color:white;
}
Make your DIVs focusable, by adding tabIndex:
<div tabindex="1">
Section 1
</div>
<div tabindex="2">
Section 2
</div>
<div tabindex="3">
Section 3
</div>
Then you can simple use :focus
pseudo-class
div:focus {
background-color:red;
}
Demo: http://jsfiddle.net/mwbbcyja/