Responsive Equal Height Rows
This pattern is a fork of a CSS Tricks Post
To adapt this pattern for responsive use I placed it into a function and called it each time the window was resized. One note is that you must reset the div heights before you take a new measurement.
Pros
- The Equal Height Rows Designers Crave - If a desiger uses a box, those boxes better line up or they lose their Adobe license. Really!
- Seperate heights for each row - Each row's height is calculated seperately, which works better for multi row layouts.
- Light - This is a pretty short script and could be omitted from your mobile, one column layout.
Cons
- Not a pure CSS solution - There are some pure CSS solutions out there, but they rely on background gradients or table displays, all which hack around the problem, rather than really solving it. Until we get flexbox, this will have to do.
- Not 100% finished - Would like better support for subdivisions, where a div could take up space on multiple/partial rows (think Masonry)
I hope to put this design into production on a future project, so any feedback is appreciated. Feel free to contact me on twitter @micahgodbolt or visit my site for other articles and tips.