HTML and CSS Reference
In-Depth Information
Figure 8-19. Use CSS2 counters to automatically number
chapters and sections
The counters( ) value is most useful when creating nested numbered
lists. Consider these properties:
ol { counter-reset: item }
li:before { counter-increment: item ;
content: counters(item, ".") }
If you nest several <ol> elements in your document, each <li> includes
all the nested values, separated by periods. This should create the fa-
miliar numbering pattern [*] of 1, 1.1, 1.1.1 , and so on, as the nesting
increases, as we demonstrated much earlier in this chapter (refer to Fig-
ure 8-3 ) .
[*] Surely you've noticed it in this topic!
 
Search WWH ::




Custom Search