0

In the following code first sibling stays behind despite having higher z-index. Why is that?

   
<div style="z-index: 100000000000000000000000000000000000000000;position: fixed;">why its not in front?</div>

<div style="
    height: 110px;
    width: 60px;
    background: red;
    display: block;
    position: fixed;
    z-index: 100000000000000000000000000000000000;
"></div>
dasfdsa
  • 7,102
  • 8
  • 51
  • 93

1 Answers1

2

The z-index you're setting is higher than the available range. You'll need to use a value in the available range:

<div style="z-index: 1;position: fixed;">why its not in front?</div>
<div style="
    height: 110px;
    width: 60px;
    background: red;
    display: block;
    position: fixed;
    z-index: 0;
"></div>
Mobina
  • 6,369
  • 2
  • 25
  • 41