Previous Message
Next Message

center a floated div!?!]

Sent by Terrence Wood on 3 August 2004 07:07


<!-- HTML -->
<div class="withimage">
   <img class="centered" />

/** CSS **/
div.withimage {
img.centered {
   width: 100px; /* any value */
   height: 100px;
   background: #000;

On 3/8/04 5:22 PM, Wes Carr wrote:

> 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: