How do I achieve equal height divs (positioned side by side) with HTML / CSS ?

You could use jQuery, but there are better ways to do this.

This sort of question comes up a lot and there are generally 3 answers…

1. Use CSS

This is the ‘best’ way to do it, as it is the most semantically pure approach (without resorting to JS, which has its own problems). The best way is to use the display: table-cell and related values. You could also try using the faux background technique (which you can do with CSS3 gradients).

2. Use Tables

This seems to work great, but at the expense of having an unsemantic layout. You’ll also cause a stir with purists. I have all but avoided using tables, and you should too.

3. Use jQuery / JavaScript

This benefits in having the most semantic markup, except with JS disabled, you will not get the effect you desire.

Leave a Comment