You want to wrap the .square elements in a container, and then use the CSS below.
HTML:
<div id="container"> <div class ="square"></div> <div class ="square"></div> <div class ="square"></div> ... </div>
CSS
#container:hover .square{ background-color:black; }
Fiddle: http://jsfiddle.net/ajjr68ho/
Dryden long
source share