CSS layout with 2 columns, taking up all width of browser, where left column can collapse

Posted by Matt Dawdy on Stack Overflow See other posts from Stack Overflow or by Matt Dawdy
Published on 2010-04-01T14:00:07Z Indexed on 2010/04/01 14:03 UTC
Read the original article Hit count: 697

Filed under:

I want to have a 2 column layout, and have the left column able to be 200 px at first, and have a "shrink" button to shrink it down to 10px, and have the right column expand to fill all the rest of the available space. Then if they click on the "show" button (which will be all they see in the now 10px wide left column) have the left grow back to 200px and have the right column shrink by that amount.

I can't figure out how to make the right column grown and shrink without knowing the exact width of the window.

I hope this makes sense, and I really hope someone can point me in the right direction.

Browser requirements are IE8, FF3.6, Safari, and Chrome, so in theory I can use some advanced CSS techniques. At least I don't have to support IE6.

© Stack Overflow or respective owner

Related posts about css-layout