You should read about CSS specificity.
.four-across li more specific than .no-search-results , so it has a higher level of importance.
Specificity is calculated by counting the various components of your css and expressing them in the form of (a, b, c, d). This will be clearer with an example, but first components.
- Element, pseudo-element: d = 1 - (0,0,0,1)
- Class, pseudo-class, attribute: c = 1 - (0,0,1,0)
- Id: b = 1 - (0,1,0,0)
- Inline Style: a = 1 - (1,0,0,0)
Understanding CSS Style Priority: Specificity, Inheritance, and Cascade
The order of documents matters only when the specified specificity is exactly the same. In your example, the first selector is (0,0,1,1) and the second is (0,0,1,0), so the first overrides the second, regardless of how they are arranged in the CSS document.
source share