11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22<html lang="en">
3- <!-- $Id: syndata.src,v 2.67 2002-04-22 22:05:22 bbos Exp $ -->
3+ <!-- $Id: syndata.src,v 2.68 2002-04-29 19:15:23 bbos 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>
@@ -63,9 +63,12 @@ Lex, in case of multiple matches, the longest match determines the token.
6363<TR><TD>INCLUDES <TD><code>~=</code>
6464<TR><TD>DASHMATCH <TD><code>|=</code>
6565<TR><TD>DELIM <TD><var>any other character not matched by
66- the above rules, and not a single or double quote</var>
66+ the above rules, and neither a single nor a double quote</var>
6767</TABLE>
6868
69+ <p>[What should a parser do with unbalanced quotes? Do we give rules
70+ for how much to ignore after a lonely quote? BB]
71+
6972<P>The macros in curly braces ({}) above are defined as follows:
7073
7174<TABLE>
@@ -256,7 +259,7 @@ Assume, for example, that a CSS2 parser encounters this style sheet:
256259
257260<PRE>
258261@import "subs.css";
259- H1 { color: blue }
262+ h1 { color: blue }
260263@import "list.css";
261264</PRE>
262265
@@ -266,7 +269,7 @@ the whole at-rule, effectively reducing the style sheet to:
266269
267270<PRE>
268271@import "subs.css";
269- H1 { color: blue }
272+ h1 { color: blue }
270273</PRE>
271274</div>
272275
@@ -278,9 +281,9 @@ since it occurs inside a '@media' <a href="#block">block</a>.
278281@import "subs.css";
279282@media print {
280283 @import "print-main.css";
281- BODY { font-size: 10pt }
284+ body { font-size: 10pt }
282285}
283- H1 {color: blue }
286+ h1 {color: blue }
284287</PRE>
285288</div>
286289
@@ -386,21 +389,21 @@ groups.</p>
386389<div class="example"><p>
387390Thus, the following rules:</p>
388391<pre>
389- H1 { font-weight: bold }
390- H1 { font-size: 12pt }
391- H1 { line-height: 14pt }
392- H1 { font-family: Helvetica }
393- H1 { font-variant: normal }
394- H1 { font-style: normal }
392+ h1 { font-weight: bold }
393+ h1 { font-size: 12px }
394+ h1 { line-height: 14px }
395+ h1 { font-family: Helvetica }
396+ h1 { font-variant: normal }
397+ h1 { font-style: normal }
395398</pre>
396399
397400<p>are equivalent to:</p>
398401
399402<pre>
400- H1 {
403+ h1 {
401404 font-weight: bold;
402- font-size: 12pt ;
403- line-height: 14pt ;
405+ font-size: 12px ;
406+ line-height: 14px ;
404407 font-family: Helvetica;
405408 font-variant: normal;
406409 font-style: normal
@@ -432,10 +435,10 @@ and semantic restrictions on the values it accepts.
432435For example, assume a CSS2 parser encounters this style sheet:
433436
434437<PRE>
435- H1 { color: red; font-style: 12pt } /* Invalid value: 12pt */
436- P { color: blue; font-vendor: any; /* Invalid prop.: font-vendor */
438+ h1 { color: red; font-style: 12pt } /* Invalid value: 12pt */
439+ p { color: blue; font-vendor: any; /* Invalid prop.: font-vendor */
437440 font-variant: small-caps }
438- EM EM { font-style: normal }
441+ em em { font-style: normal }
439442</PRE>
440443
441444<P> The second declaration on the first line has an invalid value
@@ -445,9 +448,9 @@ class="index-inst" title="ignore"><a href="#ignore">ignore</a></span> these
445448declarations, effectively reducing the style sheet to:
446449
447450<PRE class="example">
448- H1 { color: red; }
449- P { color: blue; font-variant: small-caps }
450- EM EM { font-style: normal }
451+ h1 { color: red; }
452+ p { color: blue; font-variant: small-caps }
453+ em em { font-style: normal }
451454</PRE>
452455</div>
453456
@@ -502,21 +505,21 @@ H1 { color: red }
502505declaration with an illegal value. For example:
503506
504507<PRE class="illegal-example">
505- IMG { float: left } /* correct CSS2 */
506- IMG { float: left here } /* "here" is not a value of 'float' */
507- IMG { background: "red" } /* keywords cannot be quoted in CSS2 */
508- IMG { border-width: 3 } /* a unit must be specified for length values */
508+ img { float: left } /* correct CSS2 */
509+ img { float: left here } /* "here" is not a value of 'float' */
510+ img { background: "red" } /* keywords cannot be quoted in CSS2 */
511+ img { border-width: 3 } /* a unit must be specified for length values */
509512</PRE>
510513
511514A CSS2 parser would honor the first rule and
512515<span class="index-inst" title="ignore"><a href="#ignore">ignore</a></span>
513516the rest, as if the style sheet had been:
514517
515518<PRE class="example">
516- IMG { float: left }
517- IMG { }
518- IMG { }
519- IMG { }
519+ img { float: left }
520+ img { }
521+ img { }
522+ img { }
520523</PRE>
521524
522525<P>A user agent conforming to a future CSS specification may accept one or
@@ -607,9 +610,9 @@ display to a laser printer).
607610
608611<div class="example"><P>
609612<PRE>
610- H1 { margin: 0.5em } /* em */
611- H1 { margin: 1ex } /* ex */
612- P { font-size: 12px } /* px */
613+ h1 { margin: 0.5em } /* em */
614+ h1 { margin: 1ex } /* ex */
615+ p { font-size: 12px } /* px */
613616</PRE>
614617</div>
615618
@@ -632,18 +635,18 @@ an 'ex' is defined even for fonts that don't contain an "x".
632635<P>The rule:
633636
634637<PRE>
635- H1 { line-height: 1.2em }
638+ h1 { line-height: 1.2em }
636639</PRE>
637640
638- <P>means that the line height of H1 elements will be 20% greater
639- than the font size of the H1 elements. On the other hand:
641+ <P>means that the line height of "h1" elements will be 20% greater
642+ than the font size of the "h1" elements. On the other hand:
640643
641644<PRE>
642- H1 { font-size: 1.2em }
645+ h1 { font-size: 1.2em }
643646</PRE>
644647
645- <P>means that the font-size of H1 elements will be 20% greater than
646- the font size inherited by H1 elements.
648+ <P>means that the font-size of "h1" elements will be 20% greater than
649+ the font size inherited by "h1" elements.
647650</div>
648651
649652<P>When specified for the root of the <a href="conform.html#doctree">
@@ -697,15 +700,15 @@ href="cascade.html#computed-value">computed values</a>.</p>
697700
698701<div class="example"><P>
699702In the following rules, the computed <span
700- class="propinst-text-indent">'text-indent'</span> value of H1 elements
701- will be 36pt , not 45pt , if H1 is a child of the BODY element.
703+ class="propinst-text-indent">'text-indent'</span> value of "h1" elements
704+ will be 36px , not 45px , if "h1" is a child of the "body" element.
702705
703706<PRE>
704- BODY {
705- font-size: 12pt ;
706- text-indent: 3em; /* i.e., 36pt */
707+ body {
708+ font-size: 12px ;
709+ text-indent: 3em; /* i.e., 36px */
707710}
708- H1 { font-size: 15pt }
711+ h1 { font-size: 15px }
709712</PRE>
710713</div>
711714
@@ -723,11 +726,11 @@ of the output medium are known. The absolute units are:
723726
724727<div class="example"><P>
725728<PRE>
726- H1 { margin: 0.5in } /* inches */
727- H2 { line-height: 3cm } /* centimeters */
728- H3 { word-spacing: 4mm } /* millimeters */
729- H4 { font-size: 12pt } /* points */
730- H4 { font-size: 1pc } /* picas */
729+ h1 { margin: 0.5in } /* inches */
730+ h2 { line-height: 3cm } /* centimeters */
731+ h3 { word-spacing: 4mm } /* millimeters */
732+ h4 { font-size: 12pt } /* points */
733+ h4 { font-size: 1pc } /* picas */
731734</PRE>
732735</div>
733736
@@ -761,13 +764,13 @@ href="cascade.html#initial-value">initial value</a> of that property.
761764Since child elements (generally) inherit the <a
762765href="cascade.html#computed-value">computed values</a> of their parent, in
763766the following example, the children of the P element will inherit a
764- value of 12pt for <span
767+ value of 12px for <span
765768class="propinst-line-height">'line-height'</span>, not the percentage
766769value (120%):
767770
768771<PRE>
769- P { font-size: 10pt }
770- P { line-height: 120% } /* 120% of 'font-size' */
772+ p { font-size: 10px }
773+ p { line-height: 120% } /* 120% of 'font-size' */
771774</PRE>
772775</div>
773776
@@ -791,7 +794,7 @@ functional notation used to designate URIs in property values is
791794
792795<div class="example"><P>
793796<PRE>
794- BODY { background: url("http://www.bg.com/pinkish.gif") }
797+ body { background: url("http://www.bg.com/pinkish.gif") }
795798</PRE>
796799</div>
797800
@@ -804,7 +807,7 @@ character followed by optional whitespace followed by
804807
805808<div class="example"><P>An example without quotes:
806809<PRE>
807- LI { list-style: url(http://www.redballs.com/redball.png) disc }
810+ li { list-style: url(http://www.redballs.com/redball.png) disc }
808811</PRE>
809812</div>
810813
@@ -983,77 +986,6 @@ adjust foreground colors accordingly.
983986</div>
984987
985988
986- <H3>Angles</H3>
987- <P>Angle values (denoted by <span class="index-def"
988- title="<angle>::definition of"><a
989- name="value-def-angle"><angle></a></span> in the text) are used
990- with <a href="./aural.html">aural style sheets</a>.
991-
992- <P>Their format is a <span class="index-inst"
993- title="<number>"><span
994- class="value-inst-number"><number></span></span> immediately
995- followed by an angle unit identifier.
996-
997- <P>Angle unit identifiers are:</p>
998-
999- <ul>
1000- <li><strong>deg</strong>: degrees
1001- <LI><strong>grad</strong>: grads
1002- <LI><strong>rad</strong>: radians
1003- </UL>
1004-
1005- <p>Angle values may be negative. They should be normalized to the
1006- range 0-360deg by the user agent. For example, -10deg and 350deg are
1007- equivalent.
1008-
1009- <P>For example, a right angle is '90deg' or '100grad' or
1010- '1.570796326794897rad'.
1011-
1012- <H3>Times</H3>
1013-
1014- <P>Time values (denoted by <span class="index-def" title="<time>::definition of"><a name="value-def-time"><time></a></span> in the
1015- text) are used with <a href="./aural.html">aural style
1016- sheets</a>.
1017-
1018- <P>Their format is a <span class="index-inst"
1019- title="<number>"><span
1020- class="value-inst-number"><number></span></span> immediately
1021- followed by a time unit identifier.
1022-
1023- <P>Time unit identifiers are:</p>
1024-
1025- <UL>
1026- <LI><strong>ms</strong>: milliseconds
1027- <LI><strong>s</strong>: seconds
1028- </UL>
1029-
1030- <p>Time values may not be negative.
1031-
1032- <H3>Frequencies</H3>
1033-
1034- <P>Frequency values (denoted by <span class="index-def"
1035- title="<frequency>::definition of"><a
1036- name="value-def-frequency"><frequency></a></span> in the text)
1037- are used with <a href="./aural.html">aural cascading style
1038- sheets</a>.
1039-
1040- <P>Their format is a <span class="index-inst"
1041- title="<number>"><span
1042- class="value-inst-number"><number></span></span> immediately
1043- followed by a frequency unit identifier.
1044-
1045- <p>Frequency unit identifiers are:</p>
1046-
1047- <ul>
1048- <li><strong>Hz</strong>: Hertz
1049- <li><strong>kHz</strong>: kilo Hertz
1050- </ul>
1051-
1052- <p>Frequency values may not be negative.
1053-
1054- <P> For example, 200Hz (or 200hz) is a bass sound, and 6kHz (or 6khz)
1055- is a treble sound.
1056-
1057989<h3><a name="strings">Strings</a></H3>
1058990
1059991<P><span class="index-def" title="<string>, definition of"><a
@@ -1191,13 +1123,13 @@ for both the "style" attribute and the STYLE element.
11911123For example, we recommend:</em></p>
11921124
11931125<pre class="html-example">
1194- <SPAN style="voice -family: D \FC rst ">...</SPAN>
1126+ <SPAN style="font -family: L \FC beck ">...</SPAN>
11951127</pre>
11961128
11971129<P><em>rather than:</em></p>
11981130
11991131<pre class="html-example">
1200- <SPAN style="voice -family: D &#252;rst ">...</SPAN>
1132+ <SPAN style="font -family: L &#252;beck ">...</SPAN>
12011133</pre>
12021134</div>
12031135
0 commit comments