So basically i have this wrapper div, and all the elements inside it are floated elements. Only thing is the border of the wrapper div does not include the floated elements in it. Example:
<div id = "wrapper>
<div id = "content"></div>
</div>
heres the css:
#wrapper
{
width: 1000px;
margin-left: auto;
margin-right: auto;
border: 1px solid;
}
#content
{
border: 1px solid;
width: 850px;
height: 400px;
display: block;
float: left;
}
Basically #content is not enclosed within #wrapper's border, but still aligns within it, why is this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…