Hi All
I've been struggling with the ability to increment nested ordered lists.
I'm trying to update a page that was built with multiple paragraphs that
lead off with b1.1/b...b1.2/b Etc etc
Naturally, I'd like to replace these with
ol
li
li
.
I was looking through the w3c specs and came across this example that seems
to be perfect. But I can't get it to work. Has anyone worked with this
before?
http://www.w3.org/TR/REC-CSS2/generate.html#scope
12.5.1 Nested counters and scope
Counters are self-nesting, in the sense that re-using a counter in a child
element automatically creates a new instance of the counter. This is
important for situations like lists in HTML, where elements can be nested
inside themselves to arbitrary depth. It would be impossible to define
uniquely named counters for each level.
Example(s):
Thus, the following suffices to number nested list items. The result is very
similar to that of setting 'display:list-item' and 'list-style: inside' on
the LI element:
OL { counter-reset: item }
LI { display: block }
LI:before { content: counter(item) . ; counter-increment: item }
...
The following style sheet numbers nested list items as 1, 1.1, 1.1.1,
etc.
OL { counter-reset: item }
LI { display: block }
LI:before { content: counters(item, .); counter-increment: item }
I'm checking this in firefox on win.
Ted
**
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list getting help
**