How do you make a wrapped div fill the window horizontally?

Posted by Alex Parkinson on Stack Overflow See other posts from Stack Overflow or by Alex Parkinson
Published on 2010-04-26T19:01:41Z Indexed on 2010/04/26 19:03 UTC
Read the original article Hit count: 201

Filed under:
|
|

I have a div which is contained by another 960px-wide centered div. I'm adding a background to the inner div which should expand all the way to the window's edges horizontally, essentially escaping the boundaries of its container. If I apply a large negative margin and equal amount of padding, this works on the left side, but the right side causes a scroll bar to appear. Does anyone know how I can achieve this without causing scroll bars?

© Stack Overflow or respective owner

Related posts about css-layout

Related posts about css-positioning