|
1 | 1 | <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'> |
2 | 2 | <html lang="en"> |
3 | | -<!-- $Id: selector.src,v 2.36 1998-03-21 23:53:06 bbos Exp $ --> |
| 3 | +<!-- $Id: selector.src,v 2.37 1998-03-22 02:04:43 ijacobs Exp $ --> |
4 | 4 | <head> |
5 | 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
6 | 6 | <title>Selectors</title> |
@@ -29,9 +29,9 @@ case-sensitive. |
29 | 29 | <TR><TH>Pattern<TH>Meaning<TH>Described in section</TR> |
30 | 30 | <TR><TD>*<TD>Matches any element.<TD><a href="#universal-selector">Universal |
31 | 31 | selector</a></TR> |
32 | | -<TR><TD>E<TD>Matches any E element (i.e. an element of type E).<TD><a href="#type-selectors">Type |
| 32 | +<TR><TD>E<TD>Matches any E element (i.e., an element of type E).<TD><a href="#type-selectors">Type |
33 | 33 | selectors</a></TR> |
34 | | -<TR><TD>A F<TD>Matches any E element that is a descendant of |
| 34 | +<TR><TD>E F<TD>Matches any E element that is a descendant of |
35 | 35 | an F element.<TD><a href="#descendant-selectors">Descendant |
36 | 36 | selectors</a></TR> |
37 | 37 | <TR><TD>E > F<TD>Matches any F element that is a child of |
@@ -81,34 +81,32 @@ equal to "myid".<TD><a href="#id-selectors">ID selectors</a></TR> |
81 | 81 | <h2>Selector syntax</h2> |
82 | 82 |
|
83 | 83 | <P>A <span class="index-def" title="simple selector"><a |
84 | | -name="simple-selector"><dfn>simple selector</dfn></a></span> may |
85 | | -consist of several components with no intervening whitespace: one <a |
86 | | -href="#type-selectors">type selector</a> or <a |
87 | | -href="#universal-selector">universal selector</a> followed by zero or |
88 | | -more <a href="#attribute-selectors">attribute selectors</a>, <a |
89 | | -href="#id-selectors">ID selectors</a>, and <a |
90 | | -href="#pseudo-classes">pseudo-classes</a>. The universal selector may |
91 | | -be omitted, unless it is the only component. Each component specifies |
92 | | -a requirement of an element, and an element matches the simple |
93 | | -selector if it matches all of the components. |
| 84 | +name="simple-selector"><dfn>simple selector</dfn></a></span> is either |
| 85 | +a <a href="#type-selectors">type selector</a> or <a |
| 86 | +href="#universal-selector">universal selector</a> followed immediately |
| 87 | +by zero or more <a href="#attribute-selectors">attribute |
| 88 | +selectors</a>, <a href="#id-selectors">ID selectors</a> or <a |
| 89 | +href="#pseudo-classes">pseudo-classes</a>, in any order. The simple |
| 90 | +selector matches if all of its components match. |
94 | 91 |
|
95 | 92 | <P>A <span class="index-def" |
96 | 93 | title="selector"><dfn>selector</dfn></span> is a chain of one or more |
97 | | -simple selectors, separated by whitespace and/or a combinator (">" or |
98 | | -"+"). The combinator indicates a relation between the simple selectors |
99 | | -on either side. The elements of the document tree that match a |
100 | | -selector are called <span class="index-def" title="subject (of |
101 | | -selector)|selector::subject of"><a |
102 | | -name="subject"><dfn>subjects</dfn></a></span> of the selector. A |
103 | | -selector consisting of a single simple selector matches any element |
| 94 | +simple selectors separated by combinators. Combinators are: |
| 95 | +whitespace, ">", and "+". Whitespace may appear between a |
| 96 | +combinator and the simple selectors around it. |
| 97 | + |
| 98 | +<P>The elements of the document tree that match a selector are called |
| 99 | +<span class="index-def" title="subject (of selector)|selector::subject |
| 100 | +of"><a name="subject"><dfn>subjects</dfn></a></span> of the selector. |
| 101 | +A selector consisting of a single simple selector matches any element |
104 | 102 | satisfying its requirements. Prepending a simple selector and |
105 | 103 | combinator to a chain imposes additional matching constraints, so the |
106 | 104 | subjects of a selector are always a subset of the elements matching |
107 | 105 | the rightmost simple selector. |
108 | 106 |
|
109 | 107 | <P>One <a href="#pseudo-elements">pseudo-element</a> may be appended |
110 | 108 | to the last simple selector in a chain, in which case the style |
111 | | -information applies to a subpart of the subjects. |
| 109 | +information applies to a subpart of each subject. |
112 | 110 |
|
113 | 111 | <h3><a name="grouping">Grouping</a></h3> |
114 | 112 |
|
@@ -275,7 +273,7 @@ pseudo-class below. |
275 | 273 | appear next to each other in a document. For example, when block-level |
276 | 274 | elements are laid out, the vertical space between them collapses. In |
277 | 275 | this case, the special formatting is handled by the rules for <a |
278 | | -href="./visudet.html#collapsing-margins">collapsing margins</a>, but |
| 276 | +href="./box.html#collapsing-margins">collapsing margins</a>, but |
279 | 277 | in other cases of adjacent selectors, authors may want to specify |
280 | 278 | their own special formatting rules.</p> |
281 | 279 |
|
@@ -608,9 +606,6 @@ an "!important" priority to the declarations: <code>[name=p371] |
608 | 606 | without a DTD do not have IDs at all.</em> |
609 | 607 | </div> |
610 | 608 |
|
611 | | -<!-- What to do if no DTD? -IJ --> |
612 | | - |
613 | | - |
614 | 609 | <h2><a name="pseudo-elements">Pseudo-elements</a> and <a |
615 | 610 | name="pseudo-classes">pseudo-classes</a></h2> |
616 | 611 |
|
@@ -673,14 +668,6 @@ should be implemented. |
673 | 668 |
|
674 | 669 | <p>Pseudo-elements and pseudo-class names are case-insensitive.</p> |
675 | 670 |
|
676 | | -<!-- |
677 | | -<p>Several pseudo-element rules may have an impact on the same |
678 | | -content. These are called <span class="index-def" title="overlapping |
679 | | -pseudo-elements">overlapping pseudo-elements</span>. An <a |
680 | | -href="#overlapping-example">example</a> is provided below. |
681 | | - |
682 | | -[Isn't this obvious? BB]--> |
683 | | - |
684 | 671 | <P>Some pseudo-classes are mutually exclusive, while others can be |
685 | 672 | applied simultaneously to the same element. In case of conflicting |
686 | 673 | rules, the normal <a href="cascade.html#cascading-order">cascading |
|
0 commit comments