Previous Message
Next Message

center a floated div!?!] - resolved

The following terms have been highlighted: horizontally centered) [remove highlighting]

Sent by Wes Carr on 3 August 2004 15:03

Bruno Fassino wrote:

> <>If I understand well you want to "shrink wrap" (to add borders or 
> something
> like that) an image without knowledge of its width in the css, you 
> also have
> small captions, and then you want center the whole thing.
> Instead of using a float, you could use a container with
> display:table/table-cell. This gives you the shrink-wrap effect and can be
> horizontally centered with auto margins.
> But it doesn't work in IE (nor Window, neither Mac.) For these you could
> try display:inline-block, which should give the shrink wrap effect, 
> and can
> be centered inside a container with text-align:center.
> I've an example here <>
> Please note that this is just an experiment...
> Bruno

Uhmm, wow! I never really knew what table/table-cell displays were for, 
and excellent hack for IE. You've saved me much grief. The display:table 
approach works in Opera and Safari btw.

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

Message thread: