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

Re: [css3-gcpm] float:center

From: Brad Kemper <brkemper@comcast.net>
Date: Sat, 5 Jan 2008 15:41:06 -0800
Message-Id: <F35EEF16-8D0D-4713-ACA2-71BD619224C1@comcast.net>
Cc: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
To: Alex Mogilevsky <alexmog@exchange.microsoft.com>
So, "already being done" refers to this GCPM working draft [1], and  
to my knowledge not actually being implemented anywhere yet (IE8,  

On Jan 5, 2008, at 11:59 AM, Alex Mogilevsky wrote:

> With current definition of page floats,
>     "float:top left column; float-offset:0.5gr 0.5gr"
> Will center the float in the current column (or current block if it  
> only has one column).

Correct me if I am wrong, but that would only center the top and left  
edges, right? The width would still extend out to the right of  
center, and the height below it. On a two column block, the first  
"0.5gr" would center it nicely in the gutter (aka "column gap"),  
assuming the float was one column + .5 gutters wide. Unless I  
misunderstand the WD.

> There is a couple of issues with the above example:
> * float-offset includes a special behavior that makes this work:
>         "If the 'gr' unit or percentage unit is used, it means that
>         the middle of the float should be aligned with the specified
>         grid line (or portion thereof)."
> I don't particularly like that float-offset combines positioning  
> and definition of anchor point. I love the concept but I would  
> rather see separate simpler properties (perhaps "anchor-point"?).

"anchor-point" (or maybe just simply "point") would basically be a  
coordinate combining top and left, right? If we have that (and I am  
not for or against it), then it should be able to be used for any  
property that can take numerical unit values for top and left, such  
as background-position, left and right as they relate to "position:",  
etc. Of course then you have the problem of it not being useful when  
you want to position by the right or bottom. So top, bottom, right,  
and left still need to be indicated somehow. So perhaps like this, as  
an alternative to the above, for positioning floats within blocks of  

	float:absolute column; top:0.5gr; left:0.5gr;

Also, I don't particularly like that "float: right column" means that  
it goes in the right column, and not the right side of the column,  
and that "float:right" means that it it floats to the right side of  
the current column. It sounds backwards.

I don't think "column" (or "page" in the earlier portion of that  
working draft) should be part of "float", anyway. That specifies the  
container to which the coordinates applies, but that would be also be  
very useful for  other positioning schemes, such as  
position:absolute, and maybe even position:relative. So, inasmuch as  
it relates to this draft, I would prefer something like the following  
to center it between the first and second column, 1/2 :

	float:absolute; top:0.5gr; left:0.5gr; container: column;

By extension, to float it to to the top of the right-most column  
(i.e. the right side of the box), you would do this:

	float:absolute; top:0; right:0; container: block;
	/* or maybe "container:parent;" */
	/* or maybe "container:default;" */

This might also be used to address David Wooley's concern about where  
in the HTML document you put something like a pull quote or  
illustration, which relates more to the entire article or possibly  
the whole page than to any particular column you might stick it in.  
Using the above, you could put the pull quote at the begging or end  
of the article.

If this was extended further, to specify any block as a container, it  
would be even more powerful. For instance, consider the following,  
which would allow you to put the html for the pull-quote or image (or  
whatever) anywhere in the document:

	float:absolute; top:0; right:0; container: id(myColumnBox);

This also seems simpler and more straightforward than the "named  
flows" of the same working draft [2].

> * It isn't well defined how text floats around all possible page  
> floats. I agree that it rarely makes sense to wrap text on both  
> sides of a float. I don't want to say however that it never makes  
> sense.
> It is a design decision and should be made by the author, not  
> restricted by technology.

Thank you. Exactly a point I've tried to make, and James Elmore too  
(if he doesn't mind my speaking for him on this small but important  
point). It is good to read those words from an implementor, as  
obvious as they may sound to some of us authors who like to design  

> BTW, when you combine page floats with tight wrap, wrapping on both  
> sides of a float will suddenly make sense much more often...
> Floats should have their own control to say on which side(s) text  
> is allowed to flow. Just like "clear" but applied to float.

With float:right and float:left, it is defined, but I agree it would  
be useful once we start positioning floats in other places. Perhaps  
we could call it "flow", and have:

flow:right (the default for float:left)
flow:left (the default for float:right)
flow:split (my preferred default for float:center or other mechanisms  
that could allow inline content on both sides of a float within a  
single column, but not valid on floats that cross more than one column)

> [1] GCPM 'float-offset': http://www.w3.org/TR/css3-gcpm/#the-lsquo5
> -----Original Message-----
> From: fantasai [mailto:fantasai.lists@inkedblade.net]
> Sent: Friday, January 04, 2008 9:04 PM
> Alex Mogilevsky wrote:
>> I will agree that it is hard to define and hard to implement but  
>> it is already
>> being done
> Where?
> ...
> I think it's more reasonable to define behavior so that the text in  
> a single column
> either flows on one side, or on the other side. If the float is  
> positioned to span
> columns, then it makes sense for text to wrap around both sides.

[1] GCPM 'float-offset': http://www.w3.org/TR/css3-gcpm/#the-lsquo5
[2] GCPM 'named flows': http://www.w3.org/TR/css3-gcpm/#named1
Received on Saturday, 5 January 2008 23:51:14 UTC

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