Years and years ago, when I first began coding simple HTML, I was flabbergasted that you couldn't easily reproduce one of the most basic numbered outline formats available in Word and other word processors. See my example:
In my research I came across CSS 2.1 numbering, the counter-increment and counter-reset stuff, which appeared to be designed for what I wanted to do. It's implemented in FireFox, no luck in IE7, but because it's a bit subtle and complex my first few attempts were unsuccessful when I've tried to get it working.
I won't go into the particular or technical meaning of these CSS attributes, you can find description of that easily enough. Here's the CSS code of the example. See it in action (Doesn't work in IE, of course).
And the HTML: