Calculating CSS 2.1 selector specificity
When an element is matched by the selectors of several CSS rules, the most specific selector wins and the declarations in the corresponding rule are applied. That makes sense, but sometimes figuring out which selector is most specific can be tricky. Fortunately reading Andy Clarke’s CSS: Specificity Wars and Molly E. Holzschlag’s CSS2 and CSS2.1 Specificity Clarified will help you understand how selector specificity works and how to calculate it.
Subscribe / follow
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost