CSS Floating Divs At Variable Heights [duplicate]

To my knowledge, there’s no way to fix this problem with pure CSS (that works in all common browsers):

  • Floats don’t work.
  • display: inline-block doesn’t work.
  • position: relative with position: absolute requires manual pixel tuning. If you’re using a server-side language, and you’re working with images (or something with predictable height), you can handle the pixel tuning “automatically” with server-side code.

Instead, use jQuery Masonry.

Leave a Comment