Hacker News new | past | comments | ask | show | jobs | submit login

Not just more specific rules, ones that just come later in source order too (with an identical specificity).

Oh, and more "important" rules too. "!important" overrides everything. Well, except more specific instances of !important, or instances of !important with the same specificity but later in source order.

Specificity is easy, the amount of specificity a selector has is measured using four different values represented by four single digits in four columns. (Of course, a single ID will override a thousand nested class selectors.)

And that's ignoring the origin of the rule (author, user, or user agent stylesheet).

And of course transitions override all of this.

Isn't CSS fun?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: