ok i was looking at a websites source and i was wondering why they had this in the beginning of the html:
and this for the css at the top:
#wrap {
width: 1000px;
margin-left: 5%;
border: 1px solid #CCCCCC;
}
#main {
text-align: center;
padding: 15px;
background-color: #a0cb7b;
}
the div end at the same spot and start at the same spot why didnt they just put the css from main or wrap into the css of wrap or main?
Could be a number of
Could be a number of reasons, I suppose.
I would have done it this way to avoid the box-model problem. The outer div has a fixed width and no padding while the inner div has auto-width plus padding. This will display the same whether in IE or FF without additional fixes.
Had the CSS added the padding to the "wrap" div it would have been 1000px wide (width includes padding) in IE but 1030px wide (width does not include padding) in other browsers.
Oh so the wrap is padding
Oh so the wrap is padding the actually main so the width and the padding wouldnt be together and screw up? Like padding something within the main div.