Re: float:center (was: Re: Alignment property proposal)

On Dec 27, 2007, at 8:00 AM, John Oyler wrote:

>
>
> On Dec 27, 2007, at 5:27 AM, Anne van Kesteren wrote:
>
>>
>> On Wed, 26 Dec 2007 16:55:42 +0100, Brad Kemper  
>> <brkemper@comcast.net> wrote:
>>> float:center would also be darn useful.
>>
>> Every now and then someone suggests this and I tend to ignore  
>> those e-mails as I've no idea how this would realistically work,  
>> but asking is probably better so I get an understanding of what  
>> people expect this feature to do.
>
> Can't the effect they're looking for be had by merely centering the  
> element with margin: whatever auto ? Or do they specifically want  
> text to reflow around it?

Yes, text should flow around it, as with the left and right float  
values. unless something in the text clears the float. So, auto side  
margins wouldn't work.

> What would happen if you float two elements, when floating both  
> left, they just stack up against the side, but obviously two  
> elements can't be in the center simultaneously. Would you center  
> them at their common center then,  or does the second float:  
> center'ed element wrap down below it?

With float:left, additional float:left's  would stack up against the  
side, and same with float:right's, so yes, do that. I would have them  
appear in document flow order. The total width of two or more things  
with float:center that fit within the containing block would be  
centered within that block, and additional items with float:center  
would wrap to be centered below them.

A second itemthat is float:center and clear:center (or clear:all)  
would also wrap down below it, similar to other values for float.

> How many uses of this would there realistically be? Are there any  
> examples of such in typography at all?

I agree with the examples James Elmore gives in his December 29, 2007  
post.

> It only makes sense if inline stuff reflows around it to appear on  
> both sides, but even then I can't figure out what the effect should  
> be. Do the two sides act as columns, and text wraps down the left,  
> and then starts up at the right?

Only if the containing block has columns with a column gutter  
intersecting the centered float.

> It can't do that and make much sense, but then having each line  
> skip something wide in the center and move to the other side  
> doesn't work well either.

Why not?

Received on Monday, 31 December 2007 05:58:30 UTC