I am trying to create an effect where if a user hovers over an element, the element disappears. I have tried the code below, but it seems that the display:none; breaks the CSS. I am wondering why my CSS does not work, and how I would solve my problem.
<div class="foo">text</div>
.foo:hover {
color: red;
display: none;
}
display: none. It doesn't work because it has no sense.display:none;to yourself?positionof an element when it is:hover'ed, and yet I can do that: jsfiddle.net/XtmVQ/2 I wonder if there's something in the specs which say you can't changedisplaywith a:hoverpseudo-class...