开发者

Floating left and parent height

This has probably been answered before, but I have spent some time looking and can't find an exact answer.

I have a parent div A that contains two divs B and C.

B and C are both floated left. C has no set height (grows w/ amount of text in it).

The problem: the parent A does not grow to the size of C. I know this has something to do with floating an element not being a part of the normal 开发者_运维技巧document flow, but I don't know how to fix it (setting a height on A doesn't help since it depends on the height of C).


add the property overflow:hidden to div A


a small div with clear:both after B and C (inside A) should do the trick

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜