So is it better to distinguish between the first and the last? The answer is obvious, force, do not use the difference between the last one. According to the general programming method, it is much easier to control the first item than to control the last one.
Another benefit of distinguishing the first is that CSS has one: first-child artifacts (pseudo element) allow us to easily select the first child element.
Unfortunately, the current world's most-occupied browser, IE6, does not support this pseudo element. We can manually add class to the first element and then define it. But this is not a foolproof method, especially for the size of the page to reach a certain number of large sites, it is easy to exhaustive. So, how about having JavaScript help us finish this job?
View Demo
In IE, for each first-child Li plus First-child class, then the CSS can be written:: First-child,. first-child {Some rules here ...} (Did you find this very handsome, a colon, two points, a dot, a point), very easy to maintain and manage.
P.S. I hope that a master can write generic first-child, I here the example only for Li, limited capacity!