A List Apart: Articles: Keeping Your Elements’ Kids in Line with Offspring
It occurred to me that classes resembling pseudo-classes could be added automagically through DOM Scripting. For instance, what if the first child of every element got the class first-child? And, to round things out, what about only-child and last-child as well?