Please reference this example with the following explanation:
I have a web page with an extra-wide, centered background image. I want the body width of the page to collapse to the content, and ignore the div that contains the background. In the given example, I have a simplified example of how I do this: An bg-outer div establishes the proper page width (200px wide), and an bg-inner div (400px wide) contains the extra-wide image. I then use overflow:visible and negative margins to attempt to center the wider bg-inner without increasing the page width. However, as the example shows, horizontal scrollbars appear when the browser window is less than 400px, not 200px. Why does this happen? Is there a better approach?
Thanks-
EDIT:
Here's a duplicate I ended up finding, with a similiar though slightly different solution. I like the answer wdm gives here better though.
Duplicate post: Why do negative margins affect my page width?
However this one explains better what you're trying to accomplish.
This is simple...
Demo: http://jsfiddle.net/wdm954/L3U9c/
You can add
I think all you need for what you're doing is 3 lines of CSS:
As you can see: