Saturday, November 13, 2010

z-index ie7 problem

When using z-index on my multiple level menu today, I discovered z index is not working properly in IE7. After trying all different method, I had z-index fixed, and it is finally working fine.

Two common reasons why z-index is not working in ie7 according to my experience.

1> z-index only works on positioned elements (position:absolute, position:relative, or position:fixed), so please make sure you have given the correct positions value before you use z-index.
so you have to give {position:absolute}, or {position:relative} , or {position:fixed} to the element which you want to apply z-index property.

2>When working in ie7, you need to take note that, z-index is applied from parent to children. and it calculates the position on the same level. So you need to make sure you are applying z-index in correct element, best practice would be applied them on parent elements.

No comments:

Post a Comment