Re: Controling structure with CSS

On 4/15/04 2:33 PM, "Tonico Strasser" <tonico@hotpop.com> wrote:

> 
> Matt Blissett wrote:
> 
>> 
>> On Thu, 15 Apr 2004 20:34:51 +0200, Tonico Strasser <tonico@hotpop.com>
>> wrote:
>> 
>>> Hi,
>>> 
>>> a quick question: would it make sense to allow authors to rearrange
>>> the  structure of a document wit CSS?
>>> 
>>> Something like:
>>> 
>>>    .icon {
>>>      source-order: -1;
>>>    }
>> 
>> 
>> I don't think we need anything like that, CSS adds _style_, it is not
>> for  CSS to move content around. This also adds a huge layer of
>> complication --  consider selectors that depend on an elements relative
>> position  (:first-child and E + F &c)
> 
> So what would be the best way for moving elements around?

Tonico, your request is a reasonable one.  I would like to see this solved
as well, but only in a *simple* way.  After all, no need to reinvent XSLT.

A few years ago I half-seriously proposed 'float-index:<number>' to Eric
Meyer over dinner at the Peninsula Fountain and Creamery [1].

The theory being, why only 'float:left' and 'float:right'?

Why not allow things to float relative to each other along a number line,
similar to the way z-index allows layering via an integer.

This way you simply accumulate the floating/flowing elements that will fit
on a "line", and then arrange the floating elements via their index
(negative-most is left-most of the left floats, positive-most is right-most
of the right floats, float-index:0 is the same as float:none), and then flow
the remaining line box elements between the left set and the right set.

This way you would be able to arbitrarily set the left to right ordering of
a set of blocks.

Imagine there was an attribute 'num' on the elements which had some
numerical order significance, you could then do something like:

*[num] { float-index:attr(num,integer,0) }

This is just one brainstorm, I'd like to see other proposals for easily
reordering arbitrary elements.

> Another example: for screen I want to position some text on the top of
> the page, for print I want the same text at the bottom. Is this possible
> with CSS 3?

If all you want is to position one element, sure that is possible.

But if you want to "float" a bunch of elements in a particular order to the
top of the page, or to the bottom of the page, I don't think that is
possible (without building in hardcoded values dependent on the heights of
the elements involved).

I'd like to see a proposal that enables this as well.

Tantek

[1]
<http://www.jordan.palo-alto.ca.us/department/public/art~mmedia/webpage1/cre
amery.html>

Received on Thursday, 15 April 2004 17:32:55 UTC