Werner Hempel wrote: > I'm trying to do a simple three column layout, ... > http://zynist.homepage.t-online.de/layout1.html > ... The text stays in place, but the background color > of the middle column extends to the left and below the left #left-div, > ruining the layout. And the text in middle column is not visible at first, > but appears when the browser window is resized. > > But when the middle column is shorter than both side-columns the clearing > is fine again, as shown in http://zynist.homepage.t-online.de/layout2.html. > But the problem with the visibility of the text persists. > > I read about the peek-a-boo bug and all that stuff, and I tried the > Holly Hack and other things. But then the strange behaviour in IE > stops, but the clearing div doesn't get pulled down under the two side > columns but sits just below the content-div, as shown in > http://zynist.homepage.t-online.de/layout3.html.
Werner, your design relies on the clearing element in the middle column. According to the float rules, the clearing element is pushed/pulled below the floating sidebars, and will stretch the middle column (and the main container) to the max-height of the sidebars. And your concept works well in browser that respect the float and clear model. In IE, once the middle column gains "layout" via the Holly hack, the clearing context changes fundamentally: the clear cannot be affected by floats outside of the layout container [1]. Simply put, the clear does not see the floating sidebars anymore. And the middle column, disconnected from its sidebars, won't expand. There is nothing wrong with the clear implementation in IE, as the specs say "The 'clear' property does not consider floats inside the element itself or in other block formatting contexts" [2]. The main issue is that IE establishes such a "new block formatting context" by simply adding layout to the container. The spec say "Floats, absolutely positioned elements, inline-blocks, table-cells, and elements with 'overflow' other than 'visible' establish new block formatting contexts" [3]. Not a word about a simple height or width that would build such a context. To conclude, the layout model and the float model is a fundamental contradiction. When a design must avoid "layout" to work in IE, it is much likely a weak design, because a couple of issues cannot be fixed in IE without giving layout to elements. For example, you have encountered the peek-a-boo. Without the magic bullet of haslayout, all you can do is to position:relative the middle column. Great, now it is visible, but the left sidebar steps back and vanishes. The next problem you cannot solve without layout for the middle column is the three px text jog, watch the last line of the middle column, in fact the previous lines are indented by 3px alongside the float. I'd say better leave this path and go for faux columns [4] in combination with negative margins [5]. Ich hoffe, dass dir das hilft. Ingo [1] http://www.satzansatz.de/cssd/onhavinglayout.html#clear [2] http://www.w3.org/TR/CSS21/visuren.html#flow-control [3] http://www.w3.org/TR/CSS21/visuren.html#q15 [4] http://www.alistapart.com/articles/fauxcolumns/ [5] http://www.alistapart.com/articles/negativemargins/ -- http://www.satzansatz.de/css.html ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
