w3.org specification on cascadingLong story short:
ul.navbar a.hover { } takes precedence over the general
a:hover { } since it is more specifically designated (has more elements).
If the specificity is the same, then whichever one is defined later will be used. (i.e. table {} is defined at both lines 5 and 10. The one defined at 10 will be used.)
Lastly, while I don't see it listed on that page, if you have multiple stylesheet on a page that define an element, whichever is declared is used, with in-line style information overriding those. eg:
<html>
<head>
<link href="test.css" rel="stylesheet" type="text/css" />
<style type="text/css">
a { color: Red;}
</style>
</head>
<body>
<a href="test.html" style="color: Green;">Link</a>
</body>
</html>
test.css:
a { color: Blue;}
The final color will be green. Without the in-line style it'll be Red.
Intel i7 4790k @ stock, Asus Z97-PRO(Wi-Fi ac), 2x8GB Crucial DDR3 1600MHz, EVGA GTX 1080Ti FTW3
Samsung 950 Pro 512GB + 2TB Western Digital Black
Dell 2408WFP and Dell 2407WFP-HC for dual-24" goodness
Windows 10 64-bit