padding: 5px 10px 5px 10px;
This rule applies to all anchor tags and says that we want links to appear without underlines. The links should also have 5 pixels of space above, 10 pixels to the right, 5 pixels below, and 10 pixels to the left.
This rule turns all links blue (but will be overridden shortly for some cases). The colon after an element, followed by a property, indicates that we are declaring a pseudo-class
. In CSS, pseudo-classes are used to add special effects to some selectors.
This rule applies to all visited links and says that they should display with black text. Combined with the rule in step 1, visited links will look just like regular text.
This rule says that when we're hovering (i.e., putting the mouse cursor over a link), the link should display in white text, with a black background and underlined. Because this rule is after the previous rule, it will still apply when hovering over a visited link. If it was placed before the previous rule, that one would take priority.
This rule says that when the link is being clicked, turn the text red.