z-index not working with fixed positioning

Add position: relative to #over as shown in this snippet:

    #over {
      width: 600px;
      z-index: 10;
      position: relative;    
    }
    
    #under {
      position: fixed;
      top: 14px;
      width: 415px;
      left: 53px;
      border: 1px solid;
      height: 10%;
      background: #f0f;
      z-index: 1;
    }
    <!DOCTYPE html>
    <html>
    <body>
        <div id="over"><P>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</>
        </div>  
    
        <div id="under"></div>
    </body>
    </html>

Fiddle

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)