Previous Message
Next Message

Re: [css-d] Reverse Ordering of Lists

Sent by Thomas Hurst on 28 December 2002 08:08


* Joseph A Nagy Jr Enterprises [EMAIL-REMOVED]) wrote:

> In the CSS2 spec, you can specify many different formating options
> for the bullets/numbering/lettering of lists (both unordered and
> otherwise).  But they all start at 1 and go to N in ascending
> order. I'd like to create a numbered list (using traditional decimal
> (e.g. 1, 2, 3, ad infinitum)) in reverse order (e.g. 10, 9, 8, ..., 3,
> 2, 1).

Note:

  "The 'counter-increment' property accepts one or more names of
  counters (identifiers), each one optionally followed by an integer.
  The integer indicates by how much the counter is incremented for every
  occurrence of the element. The default increment is 1. Zero and
  negative integers are allowed."

> Has anyone found a way to do this? Or will I just have to manually set
> the breaks, margins, etc to make a 'faux' list?

In Opera 6+:

ol.reverse.four {
        counter-reset: countdown 5;
}

ol.reverse > li {
        display: block;
}

ol.reverse > li:before {
        counter-increment: countdown -1;
        content: counter(countdown) ". ";
}

<ol class="reverse four">
 <li>Four</li>
 <li>Three</li>
 <li>Two</li>
 <li>One</li>
</ol>

If this ordering is important, though, you're probably better off
reclassifying it as content and putting the numbers in yourself.

-- 
Thomas 'Freaky' Hurst  -  [EMAIL-REMOVED]  -  http://www.aagh.net/
Previous Message
Next Message

Message thread: