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

Re: float:center

From: James Elmore <James.Elmore@cox.net>
Date: Mon, 31 Dec 2007 09:49:28 -0800
Message-Id: <C5CEE62D-C615-4422-9A9B-B9E0FE4E4E8A@cox.net>
Cc: CSS <www-style@w3.org>
To: Brad Kemper <brkemper@comcast.net>

On Dec 30, 2007, at 10:39 PM, Brad Kemper wrote:

> 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).

I suggested this before, with very little positive response. But, I  
agree with you, possibly for other reasons than you list. I would  
like to see the ability to 'float' an element separately controllable  
from the ability to 'flow' text (and other inline elements) around an  

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

I was only considering the current 'float' options. With "float:  
left'" for example, it might look like this

0 0 0 0 0 0 0 0 0 0 0
X X X y y y y 0 0 0 0
X X X y y y y 0 0 0 0
0 0 0  y y y y 0 0 0 0
0 0 0  y y y y 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0

>>> 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.
Thank you.

James Elmore
Received on Monday, 31 December 2007 17:49:51 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:32 UTC