11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22<html lang="en">
3- <!-- $Id: syndata.src,v 2.1 1998-02-10 00:16:10 ijacobs Exp $ -->
3+ <!-- $Id: syndata.src,v 2.2 1998-02-10 22:28:42 ijacobs Exp $ -->
44<HEAD>
55<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66<TITLE>CSS2 syntax and basic data types</TITLE>
@@ -149,12 +149,15 @@ href="#escaped-characters">escaped characters.</a>
149149 <LI> <a name="escaped-characters">The backslash</a> (\) followed
150150 by at most six hexadecimal digits (0..9A..F) stands for the <a
151151 rel="biblioentry" href="./refs.html#ref-ISO10646">[ISO10646]</a>
152- character with that number.
152+ character with that number. The first space following the
153+ hexadecimal sequence is ignored. This allows authors to avoid
154+ ambiguities between, for example, hexadecimal "\26C" and
155+ hexadecimal "\26" followed immediately by the letter "C".
153156
154157 <LI> Any character except a hexadecimal digit can be escaped to
155158 remove its special meaning, by putting a backslash (\) in front,
156159 For example, <samp>"\""</samp> is a string consisting of one
157- double quote.
160+ double quote.
158161
159162 <LI> The two preceding items define <span class="index-inst"
160163 title="backslash
@@ -542,14 +545,16 @@ display to a laser printer).
542545</PRE>
543546</div>
544547
545- <P>The 'em' unit, as used in CSS, is equal to the <span
546- class="index-inst" title="font size">font size</span> used when
547- rendering an element's text. It may be used for vertical or horizontal
548- measurement. The 'ex' unit is equal to the font's <span
549- class="index-def" title="x-height"><dfn>x-height</dfn></span> (the
550- height of the letter 'x') of the element's font. A font need not
551- contain the letter "M" to have an 'em' size or the letter "x" to have
552- an x-height; the font should still define the two units.
548+ <P>The 'em' unit refers to the <span class="index-def"
549+ title="em-height"><a name="em-height"><dfn>em-height</dfn></a></span>.
550+ In CSS, the em-height is equal to the <span class="index-inst"
551+ title="font size">font size</span> used when rendering an element's
552+ text. It may be used for vertical or horizontal measurement. The 'ex'
553+ unit is equal to the font's <span class="index-def"
554+ title="x-height"><dfn>x-height</dfn></span> (the height of the letter
555+ 'x') of the element's font. A font need not contain the letter "M" to
556+ have an 'em' size or the letter "x" to have an x-height; the font
557+ should still define the two units.
553558
554559<!-- Incomplete -->
555560
@@ -602,7 +607,7 @@ href="cascade.html#computed-value">computed values</a>. For example:</p>
602607<PRE>
603608 BODY {
604609 font-size: 12pt;
605- text-indent: 3em; /* i.e. 36pt */
610+ text-indent: 3em; /* i.e., 36pt */
606611 }
607612 H1 { font-size: 15pt }
608613</PRE>
@@ -643,9 +648,12 @@ is an optional sign character ('+' or '-', with '+' being the default)
643648immediately followed by a number immediately followed by '%'.
644649
645650<P> Percentage values are always relative to another value, for
646- example a length. Each property that allows percentages also
647- defines to which value the percentage refers. When a percentage value
648- is set for a property of the root of the <a
651+ example a length. Each property that allows percentages also defines
652+ the value to which the percentage refers. The value may be that of
653+ another property for the same element, a property for an ancestor
654+ element, or a value of the rendering context (e.g., the width of a <a
655+ href="visuren.html#containing-block">containing block</a>). When a
656+ percentage value is set for a property of the root of the <a
649657href="conform.html#doctree">document tree</a> and the percentage is
650658defined as referring to the inherited value of some property X, the
651659resultant value is the percentage times the <a
@@ -660,7 +668,7 @@ the percentage value (120%):
660668
661669<PRE>
662670 P { font-size: 10pt }
663- P { line-height: 120% } /* relative to 'font-size', i.e. 12pt */
671+ P { line-height: 120% } /* relative to 'font-size', i.e., 12pt */
664672</PRE>
665673</div>
666674
@@ -824,7 +832,7 @@ identifier is optional.
824832<P>These following are legal angle unit identifiers:</p>
825833
826834<ul>
827- <li><strong>deg</strong>: degrees.
835+ <li><strong>deg</strong>: degrees
828836<LI><strong>grad</strong>: gradient
829837<LI><strong>rad</strong>: radians
830838</UL>
@@ -926,28 +934,26 @@ A[TITLE="a not so very long title"] {border: double}
926934
927935<P>A CSS style sheet is a sequence of characters from the Universal
928936Character Set, defined in <a rel="biblioentry"
929- href="./refs.html#ref-ISO10646">[ISO10646]</a> (see <a
930- rel="biblioentry" href="./refs.html#ref-HTML40"
931- class="informref">[HTML40]</a>, Chapter 5, for a discussion of
932- character sets and character encodings). For transmission and
937+ href="./refs.html#ref-ISO10646">[ISO10646]</a>. For transmission and
933938storage, these characters must be <span class="index-def"
934939title="character encoding">encoded</span> by a character encoding that
935- supports the ASCII character set and in which the ASCII characters
936- are encoded as themselves (e.g., ISO 8859-1, SHIFT JIS, etc.).
937-
938- <!-- Bert doesn't agree. What about EBCDIC? -IJ -->
940+ supports the ASCII character set (e.g., ISO 8859-x, SHIFT JIS, etc.).
941+ For a good introduction to character sets and character encodings,
942+ please consult <a rel="biblioentry" href="./refs.html#ref-HTML40"
943+ class="informref">[HTML40]</a>, Chapter 5.
939944
940945<P>When a style sheet is embedded in another document, the style sheet
941- shares the character encoding of the whole document (which is
942- determined by the <a href="conform.html#doclanguage">document
943- language</a>). In HTML, for example, the character encoding may be
944- specified by HTTP headers or the META element, as in:
946+ shares the character encoding of the whole document. ("Embedded" here
947+ means textual inclusion, not embedded byte sequences.) For
948+ example, in <a rel="biblioentry" href="./refs.html#ref-HTML40"
949+ class="informref">[HTML40]</a>, the "charset" attribute of many
950+ elements (META, LINK, A, etc.) designates the character encoding, as
951+ in:</p>
945952
946953<pre>
947954<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
948955</pre>
949956
950-
951957<P>When a style sheet resides in a separate file, user agents must
952958observe the following <span class="index-inst" title="character
953959encoding::user agent's determination of">priorities</span> when
@@ -957,25 +963,22 @@ encoding</span> (from highest priority to lowest):</p>
957963
958964<ol>
959965<li>An HTTP "charset" parameter in a "Content-Type" field.
966+ <li>The <span class="index-def" title="@charset">@charset</span>
967+ at-rule.
960968<li>Mechanisms of the language of the
961969referencing document (e.g., in HTML, the "charset"
962970attribute of the LINK element).
963- <li>The <span class="index-def" title="@charset">@charset</span>
964- at-rule.
965971</ol>
966972
967- <!-- This same "general-to-specific" ordering in HTML 4.0 has raised
968- some eyebrows, but recently received support from the HTML WG
969- in the html-editors mailing list -IJ -->
970-
971973<P>When present, only one @charset rule may appear in an external
972974style sheet -- it must <em>not</em> appear in an embedded style sheet
973- -- and it must be the first data in the document. After "@charset",
974- authors specify the name of a character encoding. The name must be a
975- charset name as described in <a href="refs.html#ref-IANA"
976- class="normref">[IANA]</a> registry (see <a rel="biblioentry"
977- href="./refs.html#ref-CHARSETS" class="informref">[CHARSETS]</a>
978- for a complete list). For example:</p>
975+ -- and it must be the first line in the document (not preceded by any
976+ other characters). After "@charset", authors specify the name of a
977+ character encoding. The name must be a charset name as described in <a
978+ href="refs.html#ref-IANA" class="normref">[IANA]</a> registry (see <a
979+ rel="biblioentry" href="./refs.html#ref-CHARSETS"
980+ class="informref">[CHARSETS]</a> for a complete list). For
981+ example:</p>
979982
980983<div class="example"><P>
981984@charset "ISO-8859-1";
@@ -984,40 +987,71 @@ for a complete list). For example:</p>
984987<P>This specification does not mandate which character encodings
985988a user agent must support.
986989
990+ <P>What purpose does the @charset construct serve if user agents
991+ cannot understand it before they know the character encoding? It acts
992+ as a verification mechanism. In the case HTTP headers do not provide
993+ character encoding information, user agents may attempt to guess the
994+ character set, and should they succeed, the @charset allows them to
995+ double check their guess. For this reason, character encodings in
996+ which the ASCII characters are encoded as themselves are more likely
997+ to help user agents determine the correct character encoding than
998+ other encodings schemes.
999+
9871000<!-- More examples of good encodings to use? -IJ -->
9881001
9891002<!-- Encodings not to use? (cf. HTML 4.0) -IJ -->
9901003
991- <h3>Encoding characters not represented in a character encoding</h3>
1004+ <h3>Referring to characters not represented in a character encoding</h3>
9921005
9931006<P>A style sheet may have to refer to characters that cannot be
9941007represented in the current character encoding. These characters must
9951008be written as <a href="#escaped-characters">escaped</a> references to
9961009<a rel="biblioentry" href="./refs.html#ref-ISO10646">[ISO10646]</a>
997- characters.
1010+ characters. These escapes are the equivalent of numeric character
1011+ references in HTML or XML documents (see <a rel="biblioentry"
1012+ href="./refs.html#ref-HTML40">[HTML40], Chapters 5 and 25).</a>
1013+
1014+ <P>The character escape mechanism should be used when only a few
1015+ characters must be represented this way. If most of a document
1016+ requires escaping, authors should encode it with a more appropriate
1017+ encoding (e.g., if the document contains a lot of Greek characters,
1018+ authors might use ISO 8859-7 or UTF 8).
1019+
1020+ <P>Intermediate processors using a different character encoding may
1021+ translate these escaped sequences into byte sequences of that
1022+ encoding. <strong>Note.</strong> Intermediate processors must not, on
1023+ the other hand, alter escape sequences that cancel the special meaning
1024+ of an ASCII character.
9981025
9991026<P><a href="conform.html#conformance">Conforming user agents</a> must
10001027correctly map to Unicode all characters in any character encodings
1001- that they recognize (or they must behave as if they did).
1028+ that they recognize (or they must behave as if they did).
10021029
10031030<P>For instance, "B&W?" may be written as "B\&W\?" or
1004- "B\26W \3F". For example, a document transmitted as ISO-8859-1
1031+ "B\26 W \3F". For example, a document transmitted as ISO-8859-1
10051032(Latin-1) cannot contain Greek letters directly:
10061033"κουρος" (Greek: "kouros") has to be
1007- written as "\3BA\3BF\3C5\3C1\3BF\3C2". These escapes are thus the CSS
1008- equivalent of numeric character references in HTML or XML documents
1009- (see <a rel="biblioentry" href="./refs.html#ref-HTML40">[HTML40],
1010- Chapters 5 and 25).</a>
1034+ written as "\3BA\3BF\3C5\3C1\3BF\3C2".
10111035
10121036<div class="note"><P>
10131037<em><strong>Note.</strong>
1014- The character escape mechanism should be used when only a few
1015- characters must be represented this way. If most of a
1016- document requires escaping, authors should encode it
1017- with a more appropriate encoding (e.g., if the document
1018- contains a lot of Greek characters, authors might use ISO 8859-7
1019- or UTF 8).
1020- </em>
1038+ In <a rel="biblioentry" href="./refs.html#ref-HTML40"
1039+ class="informref">[HTML40]</a>,
1040+ numeric character references may appear in "style" attribute
1041+ values but not in the content of the STYLE element. Because of this
1042+ asymmetry, we recommend that authors use the CSS character
1043+ escape mechanism rather than numeric character references.
1044+ For example, authors should write:</em></p>
1045+
1046+ <pre class="html-example">
1047+ <SPAN style="voice-family: D\FCrst">...</SPAN>
1048+ </pre>
1049+
1050+ <P><em>rather than:</em></p>
1051+
1052+ <pre class="html-example">
1053+ <SPAN style="voice-family: D&amp;#FC;rst">...</SPAN>
1054+ </pre>
10211055</div>
10221056
10231057</BODY>
0 commit comments