Jacob Saunders
Jacob Saunders

Reputation: 11

Child div not appearing when parent div appears

I have two divs, one inside the other. When I hover over a link, I have it set so the two divs appear. However, the parent div appears & the child div doesn't. When I have the parent set to "display:block;", the child div successfully appears. What is going on?

Thanks,

Jacob Saunders

Upvotes: 0

Views: 81

Answers (1)

user3127896
user3127896

Reputation: 6563

I've ceated demo fiddle for you using jquery to show how it works. I hope it will help you.

Here's simple script

$( document ).ready(function() {    
   $( "#hide" ).click(function() {
     $( "#parent-div" ).hide();
   });
   $( "#show" ).click(function() {
     $( "#parent-div" ).show();
   });
});

Upvotes: 1

Related Questions