If you set a div to have width:auto and don't change it's display to inline then it will automatically always be 100% of the browser....so the containing element is centered technically, because it's 100% of the width.
If you want to see it centered, give it a fixed width (e.g. 990px) and set some borders on it so you can see where the containing element is:
border: 1px solid #fff;
height: 500px; /* only if you don't have any content in it */
<link rel="stylesheet" href="css/web.css" type="text/css" media="screen"/>
<div id="container"> </div>
Where the first file is saved in a subdirectory (css) with the filename web.css.