I\'ve never been totally satisfied with my various solutions to centering content in a web page. the
tag has been deprecated back in the middle of th
body { text-align: center; }
#wrapper { width: 960px; margin: 0 auto; text-align: left; position: relative; }
#wrapper .child { position: absolute; left: 0; top: 0; }
Just example code, but any .child element would be at 0,0 of the wrapper
Any absolutely positioned element will absolutely position to it's nearest position-relative parent. If an element doesn't have a parent with position relative, it just uses the document. Below is an example without classes (some color and width styles added for clarity).
This will absolutely position relative to the container div.
This will absolutely position relative to the document