My code works, I tried it before posting. ^^
I'm centering the main div so everything inside that div is centered automatically.

You're right on the absolute positioning by the way, it can be very tricky business but in this example it would work rather well.
However, I'd suggest using relative positioning with floats (I always use this).
I didn't use it in the example because I would have to explain floats at the same time which would make the explanation a lot more complicated.
It's better to explain one thing at the time. ^^