The text to be shadowed is enclosed in a relatively positioned element. There are no position properties set, so the text appears at its normal position in the flow. The shadow is in an absolutely positioned inside (and therefore positioned relatively to) the relatively positioned . The z-index property ensures that the shadow appears underneath the text that produces it.