Previous Message
Next Message

center a floated div!?!]

Sent by Wes Carr on 3 August 2004 06:06

Henrik Bechmann wrote:

>The basic stragegy is to set a float:left; width:50%; then another
>float:left beside that, margin-left:-150px (ie. 1/2 the desired width of the
>centered div).

Unfortunately that won't work for me. The desired width is determined by 
an image inside of the floated div. The whole point of this technique is 
so that the layout does not have to be aware of any dimensions. My 
example just hard codes some dimensions on the "body" div, but it's the 
outer "content1" div that needs to be properly centered and can not know 
about the dimensions of it's children.


css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: