Read the whole of this thread: dCode_Understanding CSS Positioning by @PaulOB (he already cited from it)
For the z-index you can find it all out here: https://www.w3.org/TR/CSS21/visuren.html#propdef-z-index
Maybe the most convenient is to check http://reference.sitepoint.com/css