The main reason is that the last rules are executed after the previous ones found in the document in CSS in order, which means that the behavior of the latter will be executed after all previous agreed rules are executed. Therefore, their order is important in order to avoid overlap, which will affect each other's behavior.
If, for example :link is placed after :visited , some behavior :visited will overlap, for example, its color is displayed, probably like a regular link, despite the visit.
source share