jordashtalon — 2012-10-13T23:12:53-04:00 — #1
I have a fiddle to demonstrate the problem I'm trying to solve:
As you can see in the first row the third column is aligning to the right (because the column on the farthest left is taller then the column immediately to the right of it).
I know if I do a clear: both; after the 2nd column to get the final column to float all the way to the left, but since I'm trying to do more responsive design it would be best if I could do it without clears (since if the container became big enough I would want the column to come up flush with the rest of the columns instead of clearing).
Does anyone know how to solve this problem? I hope it made sense.
kohoutek — 2012-10-13T23:59:40-04:00 — #2
I'd not add any floats at all when you have the total layout being a mere 500 pixels wide. Instead, I'd look for breaking points in your design, e.g. if a viewport is wider than n pixels, then add a float and work your way up to the biggest viewport you want to support.
Here's a nice article that may help: http://www.netmagazine.com/tutorials/determining-breakpoints-responsive-design
ralphm — 2012-10-14T00:00:15-04:00 — #3
Instead of float: left, use display: inline-block:
border: 1px solid red;
I'm a real fan of inline-block these days.
jordashtalon — 2012-10-14T00:15:12-04:00 — #4
I love Inline-Block too but it doesn't work in IE7 unfortunately
ralphm — 2012-10-14T00:52:32-04:00 — #5
Yep, but there's an easy workaround for it in IE7. I keep messing up the explanation, though, so I'll let Paul O'Brien explain it for you instead.