CSS Specificity Algorithm Table from Evan Sharp's Mix 2010 talk

Having watched Evan Sharp’s “Comp to Code” talk at Mix 2010 video (check out the other Mix videos also, most are excellent), searching the web for the CSS specificity algorithm table turned up nothing as simple as his pseudo-decimal algorithm. So I reproduced the table from the talk verbatim here for reference. As you can see, id selector elements will dramatically increase the specificity of the selector, while class selector elements are an order of magitude less specific:

CSS specificity algorithm table

Sorry, the table didn't survive the conversion from Wordpress to Markdown/Clojure. You may want to watch the Mix Talk.

Exercise for the reader: Say "Specificity" three times fast. Extra points: Say "specificity algorithm" three times fast.

Posted: 05 July 2010

comments powered by Disqus