HTML and CSS Reference
The LoVe/HAte of Hyperlink LVHA
Links can be in multiple states at the same time, and all pseudo-
classes have identical specificity, so the order in which the link and
action pseudo-classes are defined is important. The last one that
applies at any given time will take precedence.
At the moment it is clicked, a previously visited link will match all
five of these pseudo-classes. If a:visited is the last selector of the
bunch, then those properties will be applied, and different properties
defined for the hover or active states will never be seen.
The mnemonic device LoVe/HAte is a useful way to remember the
proper order of selectors.
The target pseudo-class represents the element targeted by a named
anchor in a URI such as the top in http://example.com/index.html#top
(either by ID, or in the case of HTML4 a name attribute).
The :enabled , :disabled , and :checked pseudo-classes are used to
target form elements in various states. Any form element can be either
enabled or disabled, usually determined by the presence or lack of
a disabled HTML attribute. Check box and radio button elements can
also be :checked through user interaction or the checked attribute.
The CSS3 Basic User Interface specification has defined selectors for
the additional user interface states of :default , :valid , :invalid ,
:required , :optional , :in-range , :out-of-range , :read-only , and
:read-write . These selectors allow for the styling of the various states
available with HTML5 form elements.