Demo: z-index

We will position the elements with rules like this:

#first { position: absolute; 
  top: 100px; left: 100px; 
  z-index: 1; color: yellow }

#second { position: absolute; 
  top: 103px; left: 103px; 
  z-index: 2; color: lime }

We will position four P elements named first, second, third, and fourth. Each will be three pixels to the right and below (and in front of) the previous one and will be displayed in a different color.

Below them, we will position four rectangles (colored elements whose text is spaces only) in the same way.