Over a million developers have joined DZone.

Making Columns Render With Equal Height

A problem sometimes faced by web developers is trying to get two (or more) columns in a multi-column layout to be the same height when the content is variable.  Rather than using an arbitrary hardcoded value, the heights can be equalized (to the tallest one) with this script.

Assuming two columns in div tags with ids of "leftside" and "rightside" this script will set the height of the shorter to the height of the taller one.  The page must be in standards compliant mode with a valid doctype or IE will mess it up in quirks mode.  For longer articles and discussion  visit my home site... ERT


Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}