Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set Z index not working. button behind a container (HTML - CSS)

I using Metro css (windows 8 style) and have a problem. I have container with alerts (the blue in the picture) , and above , there is 'IT -CENTER ' , If I click there it open a button. the problem that the button behind the container.. I try to set the Z index of the container to -1 , and it's not help. enter image description here

the dropdownlist with the button(IT-CENTER): IT-CENTER

              <li style="z-index:3"><a href="Login.aspx">התנתק</a></li>
           </ul>
        </div>

and the container(blue one):

 <div id="alerts-container" style="z-index:-1">
         <div id="toast-example1" class="toast toasttext02 fade in">
            <button type="button" class="close" data-dismiss="alert"></button>
            <div class="pull-left">
               <div class="toast-object icon-info-4"></div>
            </div>
            <div class="toast-body" style="text-align:right">

(it's without the closing tags..)

what should I do?

thanks!!

like image 675
user3697289 Avatar asked Jun 06 '14 16:06

user3697289


2 Answers

  1. You must set position:relative if you are setting z-index - it is very important thing and can lead to your bug

  2. If the 1 method doesn't help you should try to set z-indexes to the possible parents of that button (can say for sure I don't see your code)

like image 188
AlexTroy Avatar answered Oct 27 '22 00:10

AlexTroy


overflow: hidden;

to parent DIV worked for me

like image 29
Azad Avatar answered Oct 26 '22 23:10

Azad