<html>
<head>
<style>
#div1 {
width:20px;
height:20px;
background:green;
}
#div1:focus,#div2:focus {
background:red;
}
#div2 {
width:20px;
height:20px;
background:blue;
}
</style>
</head>
<div id='div1' tabindex='1'></div>
<div id='div2' tabindex='2'></div>
</html>