z-index CSS Property

z-index specify the stacking order for absolute, relative and fixed positioned elements. By default z-index value is set to auto that means stack order is similar to its parent.

Definition Of z-index property:

The z-index is a property of CSS that can set stack order for a HTML element.

What z-index property can do?

This z-index property can be used when you have many elements in same parent container, so this property allows you to set the stack order for elements, the element with greater stack order will in front or lower one. It will not work with non positioned elements.

How to use CSS z-index property?

Syntax:

1
z-index: integer | aut

Example:

1
z-index:-2;

How to use CSS z-index property in Javascript?

You can set value of z-index property with Javascript in following manner:

1
object.style.zIndex="3"


Related posts

Tags: , ,

No Response

Post your response

Copyright © 2010 - 2013 Handy CSS Designed By Anotix, Powered By WordPress, all right reserved.