html
<div id="outer">
<div id="inner">
Lorem Ipsum...
</div>
</div>
css
#outer { background: url('mypic.jpg') no-repeat center top; }
#inner { width: 960px; margin: 10px auto; }
This code centers my background image nicely, except when my browser gets narrower than the 960px width of #inner. In this narrow-browser case, #inner and #outer maintain their 960px width as expected (giving a horizontal browser scroll bar), but the background image on #outer centers itself to the browser window instead of the #outer div. How can I maintain the background image to be centered to the div instead of to the browser window?