To centre fixed width block elements horizontally you just add margin:auto (specifically left and right margins should be auto). The element needs to have a width defined. If there is no width then the element is 100% wide and effectively there is nothing to centre.
To centre inline-block elements (or text) just add text-align:centre on a parent div.
In some cases you may have want width-less containers centred and then you can add display:table and margin:auto to the element and it will be centred in IE8+ (just like a normal table would with margin:auto).