HTML and CSS Reference
In-Depth Information
Name
:target
Applies to:
Any element
Description:
Matches an element which is itself matched by the fragment identifier portion of the URI
used to access the page. Thus,
http://www.w3.org/TR/css3-selectors/#target-pseudo
would be matched by
:target
and would apply the declared styles to any element with the
id
of
target-pseudo
. If that element was a paragraph, it would also be matched by
p:target
.
Examples:
:target {background: #EE0;}