I am looking for a general and complete solution to this common problem! I have HTML code like this:
<div id="CONTAINER">
<div id="CONTAINER_LEFT"></div>
<div id="CONTAINER_RIGHT"></div>
<div id="CONTAINER_CENTER"></div>
</div>
I want to write CSS that lets me align the inner div elements vertically so their top edges are in line. Other considerations:
- The Left and Right containers have fixed width.
- The Center container has to fill the remaining width between Left and
Right containers. - The height of each inner container depends upon its content
and so varies between containers. - No overlapping is intended, the aim is something like the following
image. - The height of the outer container should be equal to the greatest height
of inner containers, if it is possible!!

The colors are just for displaying the idea!
I used “float: left;” and “float: right;” properties for the Right and Left containers but if the Center container has too much content, the area of this container fills the space below the floated elements! Also, I need a footer below the root container with width of 100%; any solution should consider this!
This seems to be the simplest solution and works under IE7-9, FF, Chrome, Safari and Opera: