One type of CSS in particular makes me…

One type of CSS in particular makes me cringe every time I see it; poor selector intent. Poor selector intent means carpet bombed selectors whose key selector has way too broad a reach; a selector like .header ul{} as opposed to one like .main-nav{}; .widget h2{} instead of .widget-title; article > p:first-child{} as opposed to .intro{}. Selectors whose intent isn’t specific enough.It’s worth noting that selector intent is something I completely made up at some point today; if you think there’s a better name then please let me know!

This is more of an in-depth examination of what is know in CSS as specificity – which is a fancy way of say “how certain styles get applied to certain stuff” in the DOM.

Read more @ Shoot to kill; CSS selector intent – CSS Wizardry