Overlapping rules in CSS - what is the true logic behind?

Viewed 1185

Consider the following:

<td class="datepickerDisabled"><a href="#"><span>12</span></a></td>

In my css, there are two rules that would match for this selector:

tbody.datepickerDays td:hover {
  border-radius: 2px;
  -moz-border-radius: 2px;
  -webkit-border-radius: 2px;
  background-color: #ddd;
}

And the second one is:

td.datepickerDisabled:hover {
  background-color: white;
}

The second rule for setting background-color to white is not matched. I would think that would be the rule overriding the previous rule since it is more specific (cells with class datepickerDisabled).

1 Answers
Related