0

The title says pretty much everything. I have a wrapper div with two divs floated side by side in it. The contents and its length in both divs varies. The problem is, that I need the wrapper div to stretch only with the right div. The left div should have scrollbar, if its length exceeds the length of the right div.

One person in IRC already claimed it's impossible to do, but I refuse to believe him. CSS3 and/or HTML5 are completely acceptable since the whole site is wrote with them already.

Thanks in advance, if someone knows an answer.

Miika Arponen
  • 11
  • 1
  • 4

1 Answers1

1

Here is a fiddle I made which should accomplish what you're asking for:

http://jsfiddle.net/zftXu/1/

Just keep in mind that since the size of the right div is dynamic, if its contents become too large (off the screen), the right div will move to a row below it. If you wish to prevent this, then put an overflow and max width on the wrapper, like this:

http://jsfiddle.net/zftXu/3/

Dave
  • 6,141
  • 2
  • 38
  • 65