The main div is only going to take up the width of the window, regardless of the width of what it contains, because you didn't define an absolute width. At 100% width, it will always take up the width of its container, which in this case is the viewport. If I understand your issue correctly...