Using CSS Counters:

HTML Tutorial

CSS Tutorial

JavaScript Tutorial

Note: IE8 supports these properties only if a !DOCTYPE is specified.