Star Wars + CSS = CSS Specificity Wars
Friday, October 7th, 2005Brilliant and simple (that’s why it’s so brilliant) way of figuring out CSS specificity levels.
You give every id selector (”#whatever”) a value of 100, every class selector (”.whatever”) a value of 10 and every HTML selector (”whatever”) a value of 1. Then you add them all up and hey presto, you have the specificity value.
Add to that the Star Wars reference, and you won’t be able to go to a geek web site for a month without seeing mention of this. Still brilliant, though.



