Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 2
    Your solutions seems the cleanest to me, but I have been trying to find the reason for this in the CSS spec and I can't find it anywhere, the nearest I found is in CSS 2.1, 9.5 Floats where it says Note: this means that floats with zero outer height or negative outer height do not shorten line boxes., but it talks about line boxes i.e. lines in a paragraph, but not about adjacent boxes. Anyone more familiar with CSS spec? Commented Apr 27, 2014 at 22:28
  • This worked the best for me. I tried most of the other suggestions on here except  . Commented Jul 16, 2015 at 6:59
  • If you try this method and it's not working, then in addition to the setting min-height also set display to "block" or "inline-block" and width to 100%. That works for me. Commented Oct 27, 2020 at 17:47