|
1 | 1 | <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'> |
2 | 2 | <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 $ --> |
4 | 4 | <head> |
5 | 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
6 | 6 | <title>Selectors</title> |
@@ -36,16 +36,22 @@ an A element.<TD><a href="#descendant-selectors">Descendant |
36 | 36 | selectors</a></TR> |
37 | 37 | <TR><TD>A > B<TD>Matches any B element that is a child of |
38 | 38 | 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 | + |
39 | 43 | <TR><TD>E:link<br>E:visited <TD>Matches element E if E is the source |
40 | 44 | anchor of a hyperlink of which the target is not yet visited (:link) |
41 | 45 | 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 | + |
43 | 52 | <TR><TD>E:active<br>E:hover<br>E:focus <TD>Matches E during certain |
44 | 53 | user actions |
45 | 54 | <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> |
49 | 55 | <TR><TD>E:lang(c) <TD>Matches element of type E if it is in (human) language c |
50 | 56 | (the document language specifies how language is determined) |
51 | 57 | <TD><a href="#lang">The :lang() pseudo-class</a> |
@@ -658,6 +664,12 @@ href="#overlapping-example">example</a> is provided below. |
658 | 664 |
|
659 | 665 | [Isn't this obvious? BB]--> |
660 | 666 |
|
| 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 | + |
661 | 673 | <!-- |
662 | 674 | <P> Some common typographical effects are associated not with |
663 | 675 | structural elements but rather with typographical items as rendered. |
@@ -823,6 +835,34 @@ as in:</p> |
823 | 835 | </div> |
824 | 836 | --> |
825 | 837 |
|
| 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 | + |
826 | 866 | <h3><a name="dynamic-pseudo-classes">The dynamic pseudo-classes:</a> |
827 | 867 | <span class="index-def" title="pseudo-classes:::hover|:hover|hover |
828 | 868 | (pseudo-class)">:hover</span>, <span class="index-def" |
|
0 commit comments