Stacking Order in DHTML


Positioning elements in a document using top and left positions allows placing of elements into a document either absolutely or relative to other elements. This is a two dimensional (x and y) model. A three dimensional model (including a z axis) allows for elements to be placed on top of each other in a stacking order relative to each other.

#item1 { position: absolute; z-index: 3; top: 305px; left: 605px; }
#item2 { position: absolute; z-index: 2; top: 205px; left: 405px; }
#item3 { position: absolute; z-index: 1; top: 105px; left: 205px; }
#item4 { position: absolute; z-index: 0; top: 5px; left: 5px; }