When learning CSS many moons ago, I was introduced to remembering "LoVe HAte" also and even now I almost unconsciously say to myself, when writing link styles, "love hate". Whatever works, works. :)
Just to clarify things a little about the utility of this topic. What we're discussing is the order in which CSS styles must be written in order to make the cascade useful for hyperlink styling. Certain
pseudo-selectors occur when activity occurs on a hyperlink (hover, et al) but if you write them in the wrong order, one style will overrule another and won't produce the desired effect. A more thorough explanation comes from
Eric Meyer on Link Specificity but essentially each of the link style types carry the same 'weight' so the last applicable one will be chosen.
Take the following CSS:
css Code:
/* LVAH = wrong */
a:link { colour: #69c; }
a:visited { color: #9c6; }
a:active { color: #000; }
a:hover { color: #c63; }
The "active" style will never be applied when a visitor clicks down onto the link, because the "hover" style will always overrule it since it is the last one in the list.
The way I generally apply my link styles is along the following pattern:
css Code:
a:link, a:visited { ... }
a:hover { ... }
a:active { ... }
This is pretty much following the LoVe/HAte pattern but since a link can never be both :link (ie, the default link state) and :visited (a visited link) we can safely join those styles together -- the usability people will cut my throat because I very often style unvisited and visited links in the same styles.