well.. It is quite easy to centering your div.
use this attribute in your css to center your div.
margin-left:auto;
margin-right:auto;
width:500px;
centering your div in the html will require this three attribute to be embedded into your css.
without the width:xxxx
you couldnt center it. because it didnt have the exact measurement to be centered.