Facebook
Banner
XMPP JavaScript Library READ MORE

Solution to z-index not working.

CSS, Sachin Puri, 2012-01-24 19:44:32

Problem

CSS property z-index not working.

Introduction 

If you are trying to use z-index and it's not working then you have to make sure that you are using position attribute.

CSS position attribute can have following values

position:absolute

position:relative

position:fixed

Erroneous Code

<div style="width:500px; height:500px; z-index:5px"></div>

Solution

<div style="width:500px; height:500px; z-index:5px; position:relative"></div>

 

 

 

Add Your Comment
   
    Yes! I want to receive all comments by email

  by Rahul on 03-Mar-2012 04:18 pm
It Worked Thanks
  • Reply
  •  2 Like
  •  1 Dislike
  • Report