I'm doing a minimalist memory game, to practice HTML and CSS code, but as a good beginner, I can not find how when the user clicks on a letter (not the effect: hover) it shows the back.
In other words, I have the following object:
Stylized with this code;
.cards {
display: block;
background-image: url("http://i492.photobucket.com/albums/rr281/neversinned/design/icons/256x256/other/Globe.png"),-webkit-linear-gradient(Royalblue,Royalblue);
background-image: url("http://i492.photobucket.com/albums/rr281/neversinned/design/icons/256x256/other/Globe.png"),-moz-linear-gradient(Royalblue,Royalblue);
background-image: url("http://i492.photobucket.com/albums/rr281/neversinned/design/icons/256x256/other/Globe.png"),-o-linear-gradient(Royalblue,Royalblue);
background-image: url("http://i492.photobucket.com/albums/rr281/neversinned/design/icons/256x256/other/Globe.png"),linear-gradient(Royalblue,Royalblue);
background-size: 110px, cover;
background-repeat: no-repeat, no-repeat;
background-position: center;
width: 200px;
height: 255px;
border: 5px solid white;
border-radius: 5px;
}
<!DOCTYPE html>
<html>
<div class="cards">
</div>
</html>
But I want to click on it to execute this code instead of the other, showing the "back" of the "letter":
.cards {
display: block;
background-image: url("http://i492.photobucket.com/albums/rr281/neversinned/design/icons/256x256/other/Globe.png"),-webkit-linear-gradient(Red,Red);
background-image: url("http://i492.photobucket.com/albums/rr281/neversinned/design/icons/256x256/other/Globe.png"),-moz-linear-gradient(Red,Red);
background-image: url("http://i492.photobucket.com/albums/rr281/neversinned/design/icons/256x256/other/Globe.png"),-o-linear-gradient(Red,Red);
background-image: url("http://i492.photobucket.com/albums/rr281/neversinned/design/icons/256x256/other/Globe.png"),linear-gradient(Red,Red);
background-size: 110px, cover;
background-repeat: no-repeat, no-repeat;
background-position: center;
width: 200px;
height: 255px;
border: 5px solid green;
border-radius: 5px;
}
Does anyone help me?