I have a box and I want to change the style, like change the border when a user click on that box.
I know this can be done through JS or jQuery, but is this possible using only CSS?
I tried using :focus and :active, it does changes the style when you click, but on release of the click it reverts the CSS
Here is my code:
CSS:
<div class="box"></div>
.box{
width:100px;
height:100px;
border:2px solid #ff0000;
}
.box:active, .box:focus {
border: 2px solid #00afec;
}
I created the Fiddle also to try: http://jsfiddle.net/cj3LV/
Please suggest!