It's Not Dark Magic: Pulling Back The Curtains From Your Stylesheets

Aimee Knight on June 04, 2017

Chances are if you're a web developer you're going to have to write some CSS from time to time. When you first looked at CSS it probably seemed l... [Read Full]
markdown guide

I think it’s important to note that this is not how specificity is calculated. It is not a single number. Rather, each selector type is counted in a base-infinity count. The selector with the highest count of each in order is the one who wins.

.container #main a = 1,1,1 not 111. A selector with 10 classes = 0,10,0 not 0100. This is why #main would always beat .container * 10.


Thank you Jason! I should have clarified this further!


Great read, thanks for that! :)

For anyone looking for ways to see this stuff working under the hood, be sure to check out Chrome's debugger views for browser painting:


This is an amazing article. Thanks for clearing up a lot of things.

code of conduct - report abuse