Girish Mahajan (Editor)

Z index

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

z-index is a CSS property that sets the stack order of specific elements. An element with greater stack order is always in front of another element with lower stack order.

Negative stack orders can also be used in the same manner. A negative value will appear behind a positive one. z-index only works on elements that have a position value (e.g. position: relative;). Like all other CSS properties, it can be set with JavaScript as well with the following syntax:

References

Z-index Wikipedia