There may be a simple fix for this, but it has troubled me for ages now...
Let me explain the situation. I have a div with the ID 'container' that holds all the contents in the page (including header and footer also) that will keep everything inline and I can do just 1 simple 'margin:0 auto;' instead of multiples. So lets say that I have the width of #container set to 80%. Now if I put another div inside with the same width (80%) and give it the ID of 'header' with 10px of padding all around, the layout would "break" (so to speak) because the page adds the padding amount onto the width. So, how can I make it stay in-bounds without using methods such as a lower percentage for the #header div? Basically, I want to make it fluid.
Here is some example code to give you an idea of what I am talking about...
CSS
#container {
position:relative;
width:80%;
height:auto;
}
#header {
position:relative;
width:80%;
height:50px;
padding:10px;
}
HTML
<div id="container">
<div id="header">Header contents</div>
</div>
Can anyone help me out with this issue that has been bugging me forever?