Because there is a priority order.
if hover was before visited, then hover wouldn't get ever applied, because it would be "forever" overwritten by visited style (if it has been really visited), that was applied after.
Same goes for :active (mouse down) - if it's defined before hover, then hover will always overwrite :active(mouse down)
Makes sense?
On the other hand, this is just "conventional rule" - it is not forced. If anyone wants to have :visited higher priority, overriding :hover/:active - you are free to do so - it simply would be just unconventional
And lastly, it is not only order that plays the role of style priority.
Elements that are more explicitly defined have higher priority.
Styles that are !important
will have higher priority than explicitly defined styles.
Explicitly defined styles with !important
and set last will have "ultimate" priority.
To question "Why would you want to use these to override styles? Wouldn't it be better just to make styles in your CSS file correctly ordered?" - Reason to use overrides by more explicit definition and !important priority overrides comes handy when you use large css/theme/bootstrap, that you haven't created and you have to quickly override/change some stuff... These dirty overrides come as a quick/cheap (not very pretty) solution.
.theBad:active {
color: red;
}
.theBad:hover {
color: green;
}
.theGood:hover {
color: green;
}
.theGood:active {
color: red;
}
<a href="#" class="theGood">the Good</a> - this will turn red on mouse down
<br />
<a href="#" class="theBad">the Bad</a> - this poor little thing will not
<!--#ordermatters, The Ugly is lurking somewhere in the shadows-->