Re: Reverse numbering of ordered lists

>> What is the best way to construct an ordered list such that the numbering
>> countd *down*...i.e., 3. 2. 1.
>>
>> Is this even possible?
> 
> http://www.w3.org/TR/CSS21/generate.html#propdef-counter-increment looks
> promising.  "Zero and negative integers are allowed."

But you would have to count all the items before rendering the first (or
get 0, -1, -2, -3) and this does, afaik, not yet work automatically.

It would need something like

ul {
 counter-reset: name count(li);
}

li::before {
 content: counter(name) ".";
 counter-increment: name -1;
}

To produce 3, 2, 1

But this would require lookahead which somebody does not like...

It was, iirc, the reason why CSS-selectors would not get "predicates"
like in XPath: //ul[li/a] "select every ul which has an li with an a in
it" could be ul:with(li > a)

Everything would be so much easier, besides the fact that :only-child
already requires some lookahead (at least up to the next tag)



-- 
pascal

Received on Monday, 6 August 2007 09:06:44 UTC