Hello,
consider the following code of three floated columns:
What I want is that when the browser resizes to the degree that not all 3 columns can fit side by side, then the 3rd column will collapse under the 1st column, without leaving a gab between them. This should happen regardless of the heights of any of the 3 columns.HTML Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>test</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> #sidebar, #sidebar2, #sidebar3 { float: left; width: 185px; height: 400px; background: green; } #sidebar2 { height: 300px; background: yellow; } #sidebar3 { background: blue; } </style> </head> <body> <div id="sidebar"> sidebar1 </div> <div id="sidebar2"> siderbar2 </div> <div id="sidebar3"> siderbar3 </div> </body> </html>
As it is now, if the 2nd column is shorter than the 1st (as in the example above) then the 3rd column collapses under the 2nd and not the 1st column. if the 2nd column is longer, then the 3rd column collapses under the 1st, but it leaves a gab between them.
Obviously this is the standard behavior of floats, but I need some sort of hack that will get me the results I want, at least with modern browsers (I6 and better).
Thanks







Bookmarks