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
The text-align: center;
property does what
used to and it is vastly superior to it.
Only thing is, it's a bit more complex to use. Once you get the hang of it, you'll wonder why you were having so much trouble before!
You must use it in coordination with the properties of other elements on the page. That is the issue developers/designers have with CSS and newer HTML technologies. It gives us a powerful way to present our page elements but makes it much more complex and strict.
Mike Robinson's answer certainly solves the problem you're having here and it's a great example. But...
I don't think any one answer will show you how to use text-align
properly for all cases you'll come across but try looking into how positioning in CSS works more in-depth.