Forum Moderators: not2easy
situation
i have three divs:
<div id="main">
<div id="left">...</div>
<div id="right">...</div>
</div>
the "left" div is simply floated to the left and "right" div - to the right side (as you have understood, "main" is just a container). div "left" has a background (an image) and there is some text on the div "right". because of data amount in the "right" its height is usually shifting.
question
is it possible to make the "left" div to change automatically its height accordingly to the "right" div?
thanks a lot.
1. Use a two column table
2. Add a background image/colour to the 'main' div to give the impression that the two columns are the same height
3. Use display: table; etc. for browsers that support it, and JavaScript hacks for those that don't
4. Use JavaScript for everything
Personally, I'd go for option 1 unless there was a decent semantic reason not to. In that case I'd choose option 4.
Option 2 is known as 'faux' columns, which works well but isn't ideal. The name 'faux' suggests a workaround, and I don't like them.
Option 3 not really an option, unless is works in all browsers I'm not interested.
Option 4, I use this surprisingly often. Bring on the people who argue for JS disabled!