Skip to content

Commit 0091fb8

Browse files
committed
[css2] adding the :target pseudo-class
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401200
1 parent b20dc5e commit 0091fb8

1 file changed

Lines changed: 45 additions & 5 deletions

File tree

css2/selector.src

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
22
<html lang="en">
3-
<!-- $Id: selector.src,v 2.25 1998-03-15 22:56:08 bbos Exp $ -->
3+
<!-- $Id: selector.src,v 2.26 1998-03-16 10:28:33 howcome Exp $ -->
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<title>Selectors</title>
@@ -36,16 +36,22 @@ an A element.<TD><a href="#descendant-selectors">Descendant
3636
selectors</a></TR>
3737
<TR><TD>A &gt; B<TD>Matches any B element that is a child of
3838
an element A.<TD><a href="#child-selectors">Child selectors</a></TR>
39+
<TR><TD>E:first-child<TD>Matches element E when E is the first
40+
child of some other element
41+
<TD><a href="#first-child">The :first-child pseudo-class</a></TR>
42+
3943
<TR><TD>E:link<br>E:visited <TD>Matches element E if E is the source
4044
anchor of a hyperlink of which the target is not yet visited (:link)
4145
or already visited (:visited)
42-
<TD><a href="#link-pseudo-classes">The link pseudo-classes</a>
46+
<TD><a href="#link-pseudo-classes">The link pseudo-classes</a></TR>
47+
48+
<TR><TD>E:target<TD>Matches element E if E is the target
49+
anchor of the current document
50+
<TD><a href="#target-pseudo-class">The target pseudo-class</a></TR>
51+
4352
<TR><TD>E:active<br>E:hover<br>E:focus <TD>Matches E during certain
4453
user actions
4554
<TD><a href="#dynamic-pseudo-classes">The dynamic pseudo-classes</a>
46-
<TR><TD>E:first-child<TD>Matches element E when E is the first
47-
child of some other element
48-
<TD><a href="#first-child">The :first-child pseudo-class</a></TR>
4955
<TR><TD>E:lang(c) <TD>Matches element of type E if it is in (human) language c
5056
(the document language specifies how language is determined)
5157
<TD><a href="#lang">The :lang() pseudo-class</a>
@@ -658,6 +664,12 @@ href="#overlapping-example">example</a> is provided below.
658664

659665
[Isn't this obvious? BB]-->
660666

667+
<P>Some pseudo-classes are mutually exclusive, while others can be
668+
applied simultaneously to the same element. In case of conflicting
669+
rules, the normal <a href="cascade.html#cascading-order">cascading
670+
order</A> determines the outcome.
671+
672+
661673
<!--
662674
<P> Some common typographical effects are associated not with
663675
structural elements but rather with typographical items as rendered.
@@ -823,6 +835,34 @@ as in:</p>
823835
</div>
824836
-->
825837

838+
<h3><a name="target-pseudo-class">The target pseudo-class</a>: <span
839+
class="index-def" title="pseudo-classes:::target|:target|target
840+
(pseudo-class)">:target</span></h3>
841+
842+
<P>Some URIs refer to a location within a resource. This kind of URI ends with "#" followed by an anchor identifier (called the fragment identifier).
843+
<pre>
844+
P.note:first-letter { color: red }
845+
</pre>
846+
847+
848+
<P>URIs with fragment identifiers link to a certain element within the
849+
document, known as the target element. For instance, here is a URI
850+
pointing to an anchor named section_2:
851+
852+
<PRE>
853+
http://somesite.com/html/top.html#section_2
854+
</PRE>
855+
856+
<P>The target element can be styled with the :target pseudo-class:
857+
858+
<pre>
859+
:target { color: red }
860+
</pre>
861+
862+
<P>If the URI that has been followed has no fragment identifier, the
863+
rule above will have no effect.
864+
865+
826866
<h3><a name="dynamic-pseudo-classes">The dynamic pseudo-classes:</a>
827867
<span class="index-def" title="pseudo-classes:::hover|:hover|hover
828868
(pseudo-class)">:hover</span>, <span class="index-def"

0 commit comments

Comments
 (0)