Ich möchte einfach eine rote Grenze über die #cont
hinzufügen, aber wenn ich diese drei Boxen schweben die Grenze funktioniert nicht und es kommt nur oben nicht Wrapping all die div.wie auch immer ich verwenden kann Überlauf: auto. es funktioniert, aber ich wollte nur wissen, warum es nicht ohne Überlauf funktioniert.Grenze in css nicht passend nach div
HTML:
<div id ="cont">
<div class ="box" > box1 </div>
<div class ="box" > box2 </div>
<div class ="box" > box3 </div>
</div>
<div id="foo">footer</div>
CSS:
#cont {
width:950px;
border:1px solid red;
}
.box {
width:300px;
height:100px;
border:1px solid black;
background-color:orange;
float:left;
}
#foo {
width:100px;
background-color:blue;
clear:both;
}
Sie den Link zu Ihrem jsfiddle teilen können so tweek wir können es –
Sie [clearfix] (http://stackoverflow.com/questions/8554043 brauchen/what-is-a-clearfix) – giorgio
@Raheel Geben Sie den Link –