W3C home > Mailing lists > Public > www-style@w3.org > December 2007

Re: float:center

From: Brad Kemper <brkemper@comcast.net>
Date: Sun, 30 Dec 2007 22:39:50 -0800
Message-Id: <B890D400-1825-4B88-A7D9-9907C662B100@comcast.net>
Cc: John Oyler <johnoyler.css@gmail.com>, CSS <www-style@w3.org>
To: James Elmore <James.Elmore@cox.net>

On Dec 29, 2007, at 12:27 PM, James Elmore wrote:
> 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?
>
> This is a problem I noticed before, and commented on, but got no  
> replies when I posted. 'float' does several things:
>     1. changes the position of the block being 'floated' to the  
> left or right.
>     2. moves inline blocks and text which had already been  
> positioned so the 'float' is not over it. and
>     3. flows the following inline elements (blocks and text) so  
> they 'wrap' around the 'floated' object.
>
> Some of these things can be controlled using CSS, but the reflow of  
> inline blocks (2 and 3) and text are only triggered by the use of a  
> 'float: left;' (or 'right'). If 'float: center;' is allowed, some  
> means of controlling the reflows will be needed. I would like to  
> see something like 'reflow' which takes parameters such as  
> 'before', 'after', and 'both'. This would allow designers to  
> control text (and inline block) reflowing around arbitrarily  
> positioned elements.

A positioned float would be cool. Stick it wherever you want, and  
inline content and other non-positioned floats would flow around it  
(unless they had clearing set on them).

> If the 'float' is sort of in the middle, the text could fill the  
> line before the element, skip the space where the 'float' is, and  
> then fill the line after the element. But this has to be under the  
> control of the designer (or layout manager).
>
>> What would happen if you float two elements, when floating both  
>> left, they just stack up against the side,
>
> Even this is not exactly set in stone. What if the first element is  
> 'short' and the second is taller. Might the designer want the text  
> after the elements where they are next to each other, but on both  
> sides of the taller element where it sticks out beyond the first  
> element? (I'm not sure that I can draw this reasonably in ASCII  
> characters. If what I've said isn't clear, I will try and explain,  
> diagram it better.

Like this?

o o o o X X X y y y y o o o o
o o o o X X X y y y y o o o o
o o o o o a a y y y y o o o o
o o o o o a a y y y y o o o o
o o o o o a a o o o o o o o o
o o o o o o o o o o o o o o o


>
>> 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?
>>
>
> Can the different things that the 'float' style keywords cause to  
> happen be controlled by the designer, so the designer can say, for  
> eXample, 'float these two items in the center, but make the second  
> clear the first'

#firstItem, #secondItem { float:center; }
#secondItem { clear:center; }

> or 'float these two items in the center, next to each other.'

#firstItem, #secondItem { float:center; clear:none; }

> The problem is that 'float' causes several things to happen, but  
> only some of them are controllable by the user.
>
> This needs to change.
>
>> How many uses of this would there realistically be? Are there any  
>> examples of such in typography at all?
>
> Some magazines used to position an image or 'pull out quote' in the  
> middle of articles. While I have seen the more common 'float  
> between columns', I have also seen the text reflowed so the words  
> just skip the area where the float is and continue on the other  
> side. (This works best with wide columns and small floats.) I even  
> recall some articles with three (narrower) columns where the  
> 'float' caused margin changes in the left and right columns, and  
> caused the text to skip over the image in the center column.

Good examples.
  
Received on Monday, 31 December 2007 06:40:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:57 GMT