-1

Is there a way to show, for example, a button which is contained in a div if that div is hidden o with display:none property? I've tried to put that button with display: inline or block but it seems that the div display property takes precedence and applies to my button

Rodrigo Martinez
  • 913
  • 3
  • 13
  • 29

2 Answers2

0

This is not possible. The button is a child element of the div.

When you place a picture into a box and then close this box, there is no way to see the picture until you open the box.

Maybe it is possible to place the button outside of the div?

WolleTD
  • 372
  • 1
  • 7
0

No, children must follow the display properties of its parent element.

If the element is hidden, the child element won't be visible. Until the parent is set to visible or display: block;

What you can do here would be to apply display: block; to div, and hide other elements inside that element and just show the only div you want to show. Then it would be possible.

Afzaal Ahmad Zeeshan
  • 15,669
  • 12
  • 55
  • 103