Kim Nylander wrote:
Greetings.

(Sorry about tsending this too early.) I am in a dilemma. I have to create
an ordered list outline with the following nested scheme:

1. Item
   a) Item
      (i) Item

I know how to change the ordered list type to alpha and roman. Is it
possible, using CSS or XHTML/HTML to change the period to a parenthesis?
If so, what is the best markup to use?

This will work in Firefox 1.5 and Opera 9.

ol { counter-reset: item }
li { display: block }
li::before { content: counter(item) ". "; counter-increment: item; }
li li::before { content: counter(item, lower-alpha) ") "; }
li li li::before { content: "(" counter(item, lower-roman) ") "; }

Once browsers support ::marker pseudo-element, this slightly simplified version will work too.

ol { counter-reset: item; }
li::marker { content: counter(item) ". "; counter-increment: item }
li li::marker { content: counter(item, lower-alpha) ") "; }
li li li::marker { content: "(" counter(item, lower-roman) ") "; }

--
Lachlan Hunt
http://lachy.id.au/


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to