How To Remember The Order of Selectors: LOVE and HATE
I read a comment the other day over on CSS Drive from someone named Slackerbabe that I thought was worth repeating.
Heres a cool way to remember the order of the four selectors, “LVHA (link visited hover active)”,….
Just think ‘LOVE’ (LV) and ‘HATE’ (HA)….
The selectors she is referencing is for anchor elements:
- a:link
- a:visited
- a:hover
- a:active














1
Thank you so much. Now I get it right. I always forget the ACTIVE selector.
Nice blog, by the way!
Comment by phil — November 30, 2007 @ 3:39 am
2
Oh! Very good! I remenber this!
Comment by Majesticskull — January 15, 2008 @ 6:27 am
3
And if you want to add a a:focus to this (which is the same as “a:hover” except it targets non-pointer-tool devices like TABs, assistive technologies for the handicapped that cannot use a “mouse”, etc),
a:link {….}
a:visited {….}
a:focus, a:hover {…}
a:active {….}
if you are a STAR WARS fan, just think:
“lord vader’s former handle anakin”
and you have just added some Accessibility s. 508 to your pages.
I was not the one to think this up, -btw. I merely repeat it here to share.
Comment by Joel A. Burdick — March 13, 2008 @ 8:16 pm