I'm trying to make a tetris board in html. I want to light the block each time you over it. So I made two div (1 block), the first div lights the two of them but I'm not able to make the second one light the first one. How can I make it work ?
CSS :
div{
width: 200px;
height: 200px;
background-color: 0000ff;
margin: 0px;
}
#div1{
float:left;
height:600px;
}
#div2{
float:left;
width:200px;
}
#div1:hover + #div2{
background-color: #0082ff;
}
#div1:hover{
background-color: #0082ff;
}
#div2:hover - #div1{
background-color: #0082ff;
}
#div2:hover{
background-color: #0082ff;
}
HTML :
<html>
<head>
<link href="style.css" type="text/css" rel="stylesheet">
<title>hover test</title>
</head>
<body>
<div id="div1"></div>
<div id="div2"></div>
</body>
</html>