This is a great question. It is exactly the kind of question that is answered by my book, which contains hundreds of solutions to problems like this.
A form is a block element not an inline element. Each type of element has a different box model in CSS and requires a different technique for positioning. Unless you understand these six box models, CSS is a great mystery that is hard to unravel.
My book, Pro CSS and HTML Design Patterns, explains the six box models and which XHTML elements use which box model. Armed with this information, my book then shows you how to position any XHTML element in any way you can imagine � using proper, valid, and accessible XHTML and CSS code that always works in all major browsers.
A form uses the block box model. In general, to center a block box, you set the left and right margins to auto using the following CSS code:
One last point. In addition to the six box models, there are three ways a box is sized in relation to its container: sized, shrinkwrapped, and stretched. These extents affect what techniques you can use to position a box. All this is clearly explained in my book with great examples that make it easy to understand and to apply in your code.
The bottom line is that there is much more to the story and the rest of the story is found in my book Pro CSS and HTML Design Patterns.