<html>
<head><style>#box1 {background: green;}.box {background: red;width: 200px;height: 200px;}div {background: firebrick;border: 2px solid black;}</style></head><body><div class="box" id="box1"></div></body></html>
]]>See that? It's not the order that tips the balance. Types have a lower specificity than classes, which in turn are less specific than IDs.
That doesn't look right, does it?