W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: flowing around both sides of a float

From: Brad Kemper <brkemper@comcast.net>
Date: Wed, 2 Jan 2008 23:51:20 -0800
Message-Id: <EF129093-6429-403B-9375-D4B1C345B9B7@comcast.net>
Cc: CSS <www-style@w3.org>
To: James Elmore <James.Elmore@cox.net>

On Jan 2, 2008, at 10:22 AM, James Elmore wrote:
> On Jan 1, 2008, at 2:51 PM, Brad Kemper wrote:
>> On Jan 1, 2008, at 1:43 PM, James Elmore wrote:
>>> On Jan 1, 2008, at 12:31 PM, John Oyler wrote:
>>> Once this style is possible, the designer can use 'position:  
>>> absolute;' or 'position: relative;' or any other CSS positioning  
>>> style to place the element, then use 'flow-around' (maybe I  
>>> called it 'wrap' in another email) to make the surrounding  
>>> elements move out of the way.
>>> I am not trying to add infinite arbitrary styles to CSS; I AM  
>>> trying to add styles which are clearly missing from CSS, just as  
>>> 'float: center;' is a clearly missing piece of the puzzle.
>> I think that is the correct thing to do, even if I would solve it  
>> a bit differently.
> So, how would you like to see it done? I am not super-glued to this  
> proposal, it just made sense to my (admittedly warped) mind to  
> allow users to control positioning and text flow separately,  
> especially since (block-level) positioning is already fairly  
> complete, with position: absolute; and 'position: relative;' and  
> their cousins.

I would say we want much the same thing, but would specify it  
differently. I would do it by giving absolute positioning as a value  
of float, and you would do it by giving certain float-like  
capabilities to absolutely positioned items.

I think your "wrap" attribute makes sense only for absolutely  
positioned items, but I can't see any use for it for static or  
relatively positioned items (or even what those terms would mean with  
wrap applied to them). Correct me if I am wrong about that.

So, if wrap only applies to absolutely positioned items, and if non- 
position aspects of float remain more or less the same, then it makes  
a little more sense to me to put them together as an attribute:value  
pair. "wrap" would not need to be a completely separate attribute if  
it only applied to absolute positioning to items that were for all  
other respects acting as floats.

Maybe it could also apply to fixed positioned items, which are  
described in CSS 2.1 as a "subcategory of absolute positioning". If  
so, then I suppose with my way I would also need "float:fixed", and  
yours would need no changes.

>>> But, I have seen so many problems in computers (especially  
>>> programming and user interfaces) where the ability to do several  
>>> things with one action/command causes problems when only part of  
>>> the ability is really needed for what the user really wants.  
>>> Therefore a user needs to cancel out part of the results because  
>>> there is no command for just the part of the actions the user  
>>> wants to accomplish, and he/she needs to use the 'shorthand' and  
>>> negate part of what the shorthand does.
>>> Just a short example: I have an inline element (possibly an  
>>> image, but not necessarily) in the middle of a paragraph. I want  
>>> the element to remain at the exact position in the paragraph, but  
>>> have the following text wrap around it.
>> For my money, I would like to see something like that handled by  
>> "float:absolute", as those 2 words mean something to people  
>> experienced with CSS, and would aid in understanding of what it  
>> would do, without a whole new context of meaning. For instance,  
>> like this:
>> p #wrapaoundme { float:absolute; left:auto; top:auto; margin:0 1em  
>> 1em 0;  }
> My proposal would probably look like:
>   p #wraparoundme { position:absolute; left:auto; top:auto: margin: 
> 0 1em 1em 0; wrap:both; }
> Not significantly different from your proposal,

I agree.

> except that it uses 'position', which I would hope any experienced  
> CSS user would recognize. I do like very much your idea of having  
> the parameters and parameter sets work exactly the same way as  
> other CSS style types.

I would hope that any experienced CSS user would recognize both  
"absolute" and "float" too. But "wrap" would be something new. The  
familiarity of the words "absolute" and "float" and the newness of  
"wrap" and what it does (applying only to absolutely or fixedly  
positioned items) makes my way a little better, IMAO (In My Arrogant  

But the syntax we use is probably just quibbling unless the general  
concept is accepted by those with the power to implement it.

>> Without numeric values for top, right, bottom, or left, it would  
>> not be moved from its place of creation (within your inline box).  
>> Top and left margins would push it to the right and bottom  
>> respectively, to allow you some control of how close the text was  
>> allow to come to it. Any numeric values for top, bottom, left, or  
>> right would be relative to the padding edge of the containing  
>> block (as with position:absolute).
>>> I can't do this with 'float' because it makes the element move to  
>>> the margin, and may even move the element down if there are other  
>>> floats already in the way.
>> One way or another, other floats would have to be accounted for.  
>> Should they move out of the way, or should your item move out of  
>> their way? Or should they overlap? I would think that something  
>> with, say, float:right, should be drawn first (since it comes  
>> earlier in the document), and thus determine the space available  
>> for the item with float:absolute.
> That is clearly a problem to be resolved. On screen (@media:  
> screen), floats allow things to move around so they don't overlap.  
> In hard copy, this is less of a problem, since the paper sizes,  
> etc., can be known before the content is printed.
> Some designs might want the elements overlapped (a slim  
> possibility, and rather silly in my mind, but possible). Other than  
> that, the 'float' changes that you are proposing and the 'position'  
> plus 'wrap' changes that I am proposing do need to allow users to  
> specify that elements need to move aside to make room for other  
> elements.

Agreed. At least in terms of inline content. I can easily imagine  
wanting to position something above two other blocks and having the  
inline content of those blocks flow around it (as well as their non- 
positioned floats).

> Maybe we could use 'position: float;' That would tell the rendering  
> engine that the EXACT position of the element is not fixed, only  
> suggested, and that it would have to move to make space for other  
> 'floated' elements.

Hmm. Or maybe it would depend on z-axis, or on the relationship of  
the item to the other floats (siblings, "cousins", etc.).

> James Elmore
Received on Thursday, 3 January 2008 07:51:33 UTC

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