How to display and hide a div with CSS?

You need Updated demo at http://jsfiddle.net/gaby/n5fzB/2/ The problem in your original CSS was that the , in css selectors starts a completely new selector. it is not combined.. so #f:hover ~ .abc,.a means #f:hover ~ .abc and .a. You set that to display:none so it was always set to be hidden for all .a elements.