CSS Div width percentage and padding without breaking layout
If you want the #header to be the same width as your container, with 10px of padding, you can leave out its width declaration. That will cause it to implicitly take up its entire parent’s width (since a div is by default a block level element). Then, since you haven’t defined a width on it, the 10px … Read more