http://www.thescripts.com/forum/threadnav100612-1-10.html
from July 2005, to which I can't reply.
The following code does "Automated numbering of nested lists with CSS". It is standard CSS, and works with Firefox and Opera. If anyone can test it with other browsers, I'd be grateful. I won't be surprised if it doesn't work with some versions of Internet Explorer, which doesn't do a great work with CSS:
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <style type="text/css">
- ul.numerada{
- counter-reset:c1;
- }
- ul.numerada > ul > ul {
- counter-reset:c2;
- }
- ul.numerada > ul > ul > ul {
- counter-reset:c3;
- }
- li{
- list-style-type: none;
- }
- ul.numerada > ul > li:before{
- counter-increment:c1;
- content: counter(c1) " ";
- background-color:gray;
- }
- ul.numerada > ul > ul > li:before{
- counter-increment:c2;
- content: counter(c1) "." counter(c2) " ";
- background-color:pink;
- }
- ul.numerada > ul > ul > ul > li:before{
- counter-increment:c3;
- content: counter(c1) "." counter(c2) "." counter(c3) " ";
- background-color:yellow;
- }
- </style>
- </head>
- <body>
- <ul class="numerada">
- <li>rar</li>
- <li>rar</li>
- <li>rar</li>
- <ul>
- <li>rar</li>
- <ul>
- <li>rar</li>
- <li>rar</li>
- <li>rar</li>
- </ul> <li>rar</li>
- <li>rar</li>
- <ul>
- <li>rar</li>
- <li>rar</li>
- <ul>
- <li>rar</li>
- <li>rar</li>
- <li>rar</li>
- </ul> <li>rar</li>
- <li>rar</li>
- <li>rar</li>
- <li>rar</li>
- </ul>
- </ul>
- <ul>
- <li>rar</li>
- <li>rar</li>
- <li>rar</li>
- </ul>
- </ul>
- </body>
- </html>