In the old days, things were so easy – one could just use <center>put stuff here</center> and be done with it. But as you know, this had it’s limitations – and not, it’s not part of the XHTML standard. Instead, you’re supposed to use CSS. But how do you make things centered? Well, there are really two ways – depending on what you are trying to do:
This is easy. You can just create a CSS class (or apply a style) of "text-align: center;" done!
Centering a div, block or container:
This, isn’t as obvious. text-align doesn’t work – and you want to stay away from using <center />. Even if you could use center ALL of the elemtents that are withint that container/div-tag or span-tag are going to be centred too, which is probably not what you want. So, here’s what I use and it seems to work. Plus this should work with with everything from a div tag to centering the main table that holds the contents for your whole site: