s1eepercat
10/9/2019 - 1:43 PM

CSS CASCADING

IMPORTANCE > SPECIFICITY > ORDER

SPECIFICITY:

#nav div .pull-right a .button {
  color: red;
}

#nav a .button:hover {
  color: green;
}

Here color wont change to green on hover, because color:red has higher specificity. (hover counts as a class)

Inline style > ID > CLASS > ELEMENT NAME
(0, 1, 2, 2) RED
(0, 1, 2, 1) GREEN 
Here, red wins by 1 element name, so red is more specific so it will overwrite green even on hover