<h1>Find the Kitten! (A Pure CSS Game)</h1>
<div class="container">
<div tabindex=1></div>
<div tabindex=2></div>
<div tabindex=3></div>
<div tabindex=4></div>
<div tabindex=5></div>
<div tabindex=6></div>
<div tabindex=7></div>
<div tabindex=8></div>
<div tabindex=9></div>
<div tabindex=10></div>
<div tabindex=11></div>
<div tabindex=12></div>
<div tabindex=13></div>
<div tabindex=14></div>
<div tabindex=15></div>
<div tabindex=16></div>
<div tabindex=17></div>
<div tabindex=18></div>
<div tabindex=19></div>
<div tabindex=20></div>
<div tabindex=21></div>
<div tabindex=22></div>
<div tabindex=23></div>
<div tabindex=24></div>
</div>
* {
transition: all .3s linear;
box-sizing: border-box;
}
h1 {
font-family: Georgia, sans-serif;
font-size: 44px;
font-weight: normal;
text-align: center;
margin: 10px 0;
font-style: italic;
color: #444;
}
.container {
overflow: hidden;
text-align: center;
}
.container div {
width: 150px;
height: 150px;
margin: 10px;
background: goldenrod;
cursor: pointer;
display: inline-block;
}
:nth-child(1):focus {
outline: none;
background: url(https://placedog.net/151/151/);
}
:nth-child(2):focus {
outline: none;
background: url(https://placedog.net/152/152/);
}
:nth-child(3):focus {
outline: none;
background: url(https://placedog.net/153/153/);
}
:nth-child(4):focus {
outline: none;
background: url(https://placedog.net/154/154/);
}
:nth-child(5):focus {
outline: none;
background: url(https://placedog.net/155/155/);
}
:nth-child(6):focus {
outline: none;
background: url(https://placedog.net/150/150/);
}
:nth-child(7):focus {
outline: none;
background: url(https://placedog.net/156/156/);
}
:nth-child(8):focus {
outline: none;
background: url(https://placedog.net/157/157/);
}
:nth-child(9):focus {
outline: none;
background: url(https://placedog.net/158/158/);
}
:nth-child(10):focus {
outline: none;
background: url(https://placedog.net/150/150/);
}
:nth-child(11):focus {
outline: none;
background: url(https://placedog.net/159/159/);
}
:nth-child(12):focus {
outline: none;
background: url(https://placekitten.com/g/150/150);
}
:nth-child(13):focus {
outline: none;
background: url(https://placedog.net/160/160/);
}
:nth-child(14):focus {
outline: none;
background: url(https://placedog.net/161/161/);
}
:nth-child(15):focus {
outline: none;
background: url(https://placedog.net/162/162/);
}
:nth-child(16):focus {
outline: none;
background: url(https://placedog.net/163/163/);
}
:nth-child(17):focus {
outline: none;
background: url(https://placedog.net/164/164/);
}
:nth-child(18):focus {
outline: none;
background: url(https://placedog.net/165/165/);
}
:nth-child(19):focus {
outline: none;
background: url(https://placedog.net/166/166/);
}
:nth-child(20):focus {
outline: none;
background: url(https://placedog.net/167/167/);
}
:nth-child(21):focus {
outline: none;
background: url(https://placedog.net/168/168/);
}
:nth-child(22):focus {
outline: none;
background: url(https://placedog.net/169/169/);
}
:nth-child(23):focus {
outline: none;
background: url(https://placedog.net/170/170/);
}
:nth-child(24):focus {
outline: none;
background: url(https://placedog.net/171/171/);
}
/*************************
Pure CSS "find game" using tabindex and :focus
See:
http://www.impressivewebs.com/using-tabindex-with-focus/
**************************/
This Pen doesn't use any external CSS resources.