Centering can sometimes be problematic. Create your container div with an id="container" or whatever.
#container {
margin-left: auto;
margin-right: auto;
}
Theorhetically, there's no reason you shouldn't be able to use shorthand rules to condense this, but I've had awful luck actually implementing it for centering. Every once in awhile I just can't get it to work and resort to the inappropriate {text-align: center;} to center a div. Obviously it's only supposed to be for text. It's several years old, but I still recommend Dave Shea's The Zen of CSS Design, as the best collection of best practices for CSS design.
__________________
-------------------------
Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe
When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper
Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
|