CSS-Tricks PSD to HTML

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

Theoretically Related Articles:

Discussion Elsewhere


Responses


  1. 1

    Gravatar

    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. 2

    Gravatar

    Oh! Very good! I remenber this!


    Comment by Majesticskull — January 15, 2008 @ 6:27 am

  3. 3

    Gravatar

    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


Leave a comment

Sick of typing in all this info everytime you comment? Register or Login and save yourself time!

Live Comment Preview


Thank you for visiting CSS-Tricks! I'm glad you found an article useful enough to print out! Remember to visit css-tricks.com often for more fresh content.