Re: flowing around both sides of a float

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.

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

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

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.

James Elmore

Received on Wednesday, 2 January 2008 18:22:57 UTC