html - When will a div collapse when applying CSS style? -
sometimes div collapses when styling. i've known floating children make parent div collapsed , same margins shared 2 divs. some demos
is there other case make div collapsed when using css?
by collapsed mean want make parent div visually contain children? second box in example.
if so, solution clear elements after float.
just add:
.container{ clear:both; } .children { float:left; }
Comments
Post a Comment