11<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
22<html lang="en">
3- <!-- $Id: selector.src,v 2.65 2002-08-02 17:45:39 bbos Exp $ -->
3+ <!-- $Id: selector.src,v 2.66 2002-09-13 23:40:54 bbos Exp $ -->
44<head>
55<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66<title>Selectors</title>
@@ -72,7 +72,8 @@ which is exactly equal to "warning".
7272beginning (from the left) with "en".
7373<TD><a href="#attribute-selectors">Attribute selectors</a>
7474</TR>
75- <TR><TD>DIV.warning<TD><em>HTML only</em>. The same as DIV[class~="warning"].
75+ <TR><TD>DIV.warning<TD><em>Language specific.</em> (In HTML, the same
76+ as DIV[class~="warning"].)
7677<TD><a href="#class-html">Class selectors</a></TR>
7778<TR><TD>E#myid<TD>Matches any E element ID
7879equal to "myid".<TD><a href="#id-selectors">ID selectors</a></TR>
@@ -90,6 +91,11 @@ selectors</a>, <a href="#id-selectors">ID selectors</a>, or <a
9091href="#pseudo-classes">pseudo-classes</a>, in any order. The simple
9192selector matches if all of its components match.
9293
94+ <p class="note">Note: the terminology used here in CSS 2.1 is
95+ different from what is used in CSS3. For example, a "simple selector"
96+ refers to a smaller part of a selector in CSS3 than in CSS 2.1.
97+ See the CSS3 Selectors module [[-CSS3SEL]].
98+
9399<P>A <span class="index-def"
94100title="selector"><dfn>selector</dfn></span> is a chain of one or more
95101simple selectors separated by combinators. <span class="index-def"
@@ -470,11 +476,23 @@ that don't get the same style as the default are explicitly covered.
470476
471477<h3><a name="class-html">Class selectors</a></h3>
472478
473- <p>For style sheets used with HTML, authors may use the dot (.)
474- notation as an alternative to the "~=" notation when matching on the
475- "class" attribute. Thus, for HTML,
476- "DIV.value" and "DIV[class~=value]" have the same meaning. The
477- attribute value must immediately follow the ".".
479+ <p>Working with HTML, authors may use the period (<code>.</code>)
480+ notation as an alternative to the <code>~=</code> notation when
481+ representing the <code>class</code> attribute. Thus, for HTML,
482+ <code>div.value</code> and <code>div[class~=value]</code> have the
483+ same meaning. The attribute value must immediately follow the
484+ "period" (<code>.</code>). UAs may apply selectors using the
485+ period (.) notation in XML documents if the UA has namespace specific
486+ knowledge that allows it to determine which attribute is the
487+ "class" attribute for the respective namespace. One such
488+ example of namespace specific knowledge is the prose in the
489+ specification for a particular namespace (e.g. SVG 1.0 [[-SVG10]]
490+ describes the <a
491+ href="http://www.w3.org/TR/2001/REC-SVG-20010904/styling.html#ClassAttribute">SVG
492+ "class" attribute</a> and how a UA should interpret it, and
493+ similarly MathML 2.0 [[-MATH20]] describes the <a
494+ href="http://www.w3.org/TR/MathML2/chapter2.html#fund_globatt">MathML
495+ "class" attribute</a>.)
478496
479497<div class="example"><p>
480498For example, we can assign style information to all elements with
@@ -795,6 +813,13 @@ a.external:visited { color: blue }
795813will cause it to be blue.
796814</div>
797815
816+ <p class=note>Note. It is possible for stylesheet authors to abuse the
817+ :link and :visited pseudo-classes to determine which sites a user has
818+ visited without the user's consent. UAs may therefore treat all links
819+ as unvisited links, or implement other measures to preserve the user's
820+ privacy while rendering visited and unvisited links differently. See
821+ [[-P3P]] for more information about handling privacy.
822+
798823<h3><a name="dynamic-pseudo-classes">The dynamic pseudo-classes:</a>
799824<span class="index-def" title="pseudo-classes:::hover|:hover|hover
800825(pseudo-class)">:hover</span>, <span class="index-def"
@@ -1030,31 +1055,6 @@ class="propinst-text-transform">'text-transform',</span> <span
10301055class="propinst-line-height">'line-height',</span> and <span
10311056class="propinst-clear">'clear'.</span></p>
10321057
1033- <p>In case a certain first line is the first line of some
1034- block-level element <var>A</var> as well as of <var>A</var>'s ancestor
1035- <var>B </var>, the fictional tag sequence is as follows:
1036-
1037- <pre><B>...<A>...<B:first-line><A:first-line>This is the first line</A:first-line></B:first-line></pre>
1038-
1039- <p>All fictional tags for first-line are inside the smallest enclosing
1040- block-level element and the nesting order of the fictional tags
1041- A:first-line and B-first-line is the same as that of the elements
1042- <var>A</var> and <var>B </var>.
1043-
1044- <p>The "first formatted line" of a block level element is the first
1045- line in the element's flow, i.e., ignoring any floats or absolutely
1046- positioned elements. For example, in
1047-
1048- <pre>
1049- <div>
1050- <p style="float: left">Floating paragraph...</p>
1051- <p>First line starts here...</p>
1052- </div>
1053- </pre>
1054-
1055- <p>The selector 'div:first-line' applies to the first line of the
1056- second p, because the first p is taken out of the flow.
1057-
10581058
10591059<h3><a name="first-letter">The</a> <span class="index-def" title="pseudo-elements:::first-letter|:first-letter|first-letter">:first-letter</span> pseudo-element</h3>
10601060
0 commit comments