Re: flowing around both sides of a float

On Jan 4, 2008, at 11:31 AM, Andrew Fedoniouk wrote:

> Here is sample rendering of one of experiments around so called  
> float:free.
>
> http://www.terrainformatica.com/w3/float-free.jpg
>
> For float:free positioning I am using flex units for @left and  
> @right so elements with
>  float:free; left:1*; right:1*;
> are positioned in the middle of space available for float  
> replacement at given vertical position.

Well, that is very interesting. You already have an experimental  
implementation of what I was calling float:absolute (or pretty darn  
close to it), and are using flex units to achieve centered floats (I  
assume you could also use other units to position in other places  
too). And to think that the Gecko guy said it would be too much  
work. ;-)

> It rises many questions as you may see. Some of them:
>
> 1) what exactly is text-align: right or center for text flowing  
> around such elements?
> 2) how rtl is handled in such contexts?
> 3) Centered paragraph (last one on the screen shot above), how you  
> would expect
>   float:free element to be positioned? In other words: how  
> float:free elements interact with
>   float:left/right ones?

The one with text-align:left on the field text looks good. But on the  
other two, I think the text should snug up to the float better. For  
instance, when the field text is text-align:right, you should fit as  
much text as will fit in each line to the right of the float before  
adding it to the left. It looks like at least the "1 2" in the first  
line of that one should move to the right, for instance. maybe that's  
the hard part? To figure out how much of the text needs to be to the  
right before you figure out what remainder should be on the left (in  
LTR writing)?

For the third example, with center aligned field text, I would expect  
the text to the left of the free float to be flush right against the  
margin of the float, and the text to the right of the free float to  
be flush left against the floats other margin. That way, all the  
field text would look like it is part of the same paragraph, with the  
ragged edges only where they needed to be for you to perceive the  
whole block as centered text.

The float left seems logical the way it is working there. Not that it  
is a pretty design, but it seems to do what I would expect it to do.

>
> In other words: it is interesting to see at least some pseudo code  
> (sequence of actions) that
> does layout of following cases:
>
> <p> 1 <foo float=left /> 2 <foo float=right /> 3 <foo float=free / 
> ></p>
> <p> 1 <foo float=right /> 2 <foo float=free /> 3 <foo float=left / 
> ></p>
>
> --
> Andrew Fedoniouk.
> http://terrainformatica.com
>
>

Received on Sunday, 6 January 2008 04:56:51 UTC