Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 15
    nice solution, even if you put div:hover {display: block;} then div will not hided when you hover div itself.. Commented Nov 14, 2011 at 18:35
  • 29
    This will make every <div> on the page display:none and when the mouse hovers over "Hover over me!" it will make every <div> following the <a> inside the same parent display:block. It might be a better idea to select by .class-name or by #id. Otherwise, good post. Commented Jun 6, 2012 at 22:59
  • 14
    add div:hover { display:block; } to keep it out while their mouse is over it Commented May 28, 2013 at 1:27
  • It might be prudent to use visibility instead of display. As I recall, it's more efficient because display redraws the div every time. Although it probably doesn't matter for one div, if you have to do many, it might be better to make them invisible instead. Commented Dec 18, 2014 at 23:01
  • 1
    how to do when a div is not a child or next div. Commented Jun 10, 2015 at 12:10