Previous Message
Next Message

Centering multiple floated blocks

Sent by Alex Robinson on 11 January 2008 22:10


A combination of display:table (Mozilla, Opera) and 
display:inline-block (IE) can cause a wrapper around floats to 
shrink-to-fit and thus be made amenable to being centered.

However, Safari (neither 2 nor 3) does not do the shrink wrapping and 
so no centering occurs. As far as I know - I'd love to be told that 
I'm wrong.


Paul O'Brien has an alternative approach that can be summed up as:

Outer wrapper:
float: left; position: relative and left: 50%

Inner wrapper
position: relative; left: -50%

    http://www.search-this.com/2007/09/19/when-is-a-float-not-a-float/


It is not without drawbacks, but it may be good enough for your needs
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: