Previous Message
Next Message

float/margin div combo - unwanted behaviour in IE

Sent by Robert Shields on 10 November 2004 09:09


Hi Bruno,

> A solution could be to wrap all in a container with sufficient width,
but
> of course you won't have a fluid layout anymore.

That's a problem - I need to have a fluid layout.

> If you don't need anything like a footer after you columns

I do need a footer - I excluded it form the example for clarity -
perhaps there was no need to exclude it.

> A better solution could be to slightly change the layout so that both
the
> left column and the main one are floated ... I've created this example
...

You rock! That's just the kind of solution I was looking for - it solves
the problem perfectly. 

Many thanks indeed,
Rob




-----Original Message-----
From: Bruno Fassino [EMAIL-REMOVED]] 
Sent: 09 November 2004 22:08
To: Robert Shields; [EMAIL-REMOVED]
Subject: RE: [css-d] float/margin div combo - unwanted behaviour in IE

Robert Shields wrote:

> I'm using a float/margin combo layout (left-floated menu, 
> content to the right with left margin) but I'm experiencing
> some unwanted behaviour in IE.
> 
> If I have a fixed-width element with my content (margin) div 
> in IE and I resize the browser to less than the combined 
> width of the float element and the fixed width element, the
> content (margin) element jumps below the float div.

This is a common problem with IE/Win and this type of layout. 
A solution could be to wrap all in a container with sufficient width,
but of course you won't have a fluid layout anymore.
If you don't need anything like a footer after you columns (in your
example you don't have one), then you could absolutely position the left
column (but I guess this is not what you want.)

A better solution could be to slightly change the layout so that both
the left column and the main one are floated. This implies using
negative margins and a couple more hacks, but solves the IE/Win problem.
I've created this example [1], starting from your page and applying the
minimum modifications necessary (I added a footer, because without this
some details get overlooked.)  Depending on your actual page this can
work for you or not.


Hth,
Bruno

[1] http://www.brunildo.org/test/test/layout-test-float-drop.html

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
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/
Previous Message
Next Message

Possibly related: