1#a:hover + #b {
2 background: #ccc
3}
4
5<div id="a">Div A</div>
6<div id="b">Div B</div>
1// If the cube is directly inside the container:
2#container:hover > #cube { background-color: yellow; }
3
4// If cube is next to (after containers closing tag) the container:
5#container:hover + #cube { background-color: yellow; }
6
7// If the cube is somewhere inside the container:
8#container:hover #cube { background-color: yellow; }
9
10// If the cube is a sibling of the container:
11#container:hover ~ #cube { background-color: yellow; }
1.showme {
2 display: none;
3}
4
5.showhim:hover .showme {
6 display: block;
7}
8
9
10<div class="showhim">HOVER ME
11 <div class="showme">hai</div>
12</div>
1#a:hover ~ #b {
2 background: #ccc
3}
4
5<div id="a">Div A</div>
6<div>random other elements</div>
7<div>random other elements</div>
8<div>random other elements</div>
9<div id="b">Div B</div>
10
1#a:hover + #b {
2 background: #ccc
3}
4
5<div id="a">Div A</div>
6<div id="b">Div B</div>
7