11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22<html lang="en">
3- <!-- $Id: syndata.src,v 1.45 1998-01-14 17:41:16 ijacobs Exp $ -->
3+ <!-- $Id: syndata.src,v 1.46 1998-01-20 23:28:27 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>
@@ -161,11 +161,11 @@ href="#skip">skips</a></span> the string.
161161
162162<P> A CSS style sheet, for any version of CSS, consists of a list of
163163<span class="index-inst" title="statements"><em>statements</em></span>
164- (see the grammar above).
165- There are two kinds of statements: <span class="index-inst"
166- title="at-rules|@-rules" ><em>at-rules</em></span> and <span
167- class="index-inst" title="rule sets"><em>rule sets .</em></span> There
168- may be whitespace (spaces, tabs, newlines) around the statements.
164+ (see the grammar above). There are two kinds of statements: <span
165+ class="index-inst" title="at-rules|@-rules"><em>at-rules</em></span>
166+ and <span class="index-inst" title="rule sets" ><em>rule
167+ sets.</em></span> There may be <a href="#whitespace">whitespace</a>
168+ around the statements.
169169
170170<P>In this specification, the expressions "immediately before" or
171171"immediate after" mean with no intervening white space or comments.
@@ -186,10 +186,10 @@ first. A CSS UA that encounters an unrecognized at-rule must
186186<span class="index-inst" title="skip"><a href="#skip">skip</a></span>
187187the whole of the @-rule and continue parsing after it.
188188
189- <P> CSS2 User agents have some additional constraints, e.g., they must
189+ <P> CSS2 user agents have some additional constraints, e.g., they must
190190also <span class="index-inst" title="skip"><a
191191href="#skip">skip</a></span> any '@import' rule that occurs inside a
192- <a href="#block">block</a> or that doesn't preceded all rule sets.
192+ <a href="#block">block</a> or that doesn't precede all rule sets.
193193
194194<div class="illegal-example"><P>
195195Here is an example. Assume a CSS2 parser encounters this style sheet:
@@ -314,7 +314,8 @@ name="properties">properties</a></H3>
314314
315315<P> A declaration consists of a <span class="index-inst"
316316title="property"><em>property</em></span>, a colon (:) and a
317- <DFN>value</DFN>. Around each of these there may be whitespace.
317+ <DFN>value</DFN>. Around each of these there may be
318+ <a href="#whitespace">whitespace</a>.
318319
319320<p>Multiple declarations for the same selector may be
320321organized into semicolon (;) separated groups.</p>
@@ -385,9 +386,9 @@ declarations, effectively reducing the style sheet to:
385386
386387<P><span class="index-inst" title="comments">Comments </span> begin
387388with the characters "/*" and end with the characters "*/". They may
388- occur anywhere where whitespace can occur and their contents have no
389- influence on the rendering.
390- Comments may not be nested.
389+ occur anywhere where <a href="# whitespace">whitespace</a> can occur
390+ and their contents have no influence on the rendering. Comments may
391+ not be nested.
391392
392393<P>CSS also allows the SGML comment delimiters ("<!--" and
393394"-->") in certain places, but they do not delimit CSS
@@ -476,27 +477,23 @@ to:</P>
476477
477478<H2>Values</H2>
478479
479- <H3>Integers and numbers</H3>
480+ <H3>Integers and real numbers</H3>
480481
481- <P>Some value types may have integer values, denoted by <span
482+ <P>Some value types may have integer values ( denoted by <span
482483class="index-def" title="<integer>::definition of"><a
483- name="value-def-integer" class="value-def"><integer></a></span>
484- in this specification.
485-
486- <P>Some value types may have number values, denoted by <span
487- class="index-def" title="<number>::definition of"><a
488- name="value-def-number" class="value-def"><number></a></span> in
489- this specification. A number may have a decimal point.
490-
491- <P>In CSS2, numbers and integers are specified in decimal notation
492- only. An <integer> consists of one or more digits "0" to "9". A
493- <number> can either be an <integer>, or it can be zero of more
494- digits followed by a dot followed by one or more digits. Both integers
495- and numbers may be preceded by a "-" or "+" to indicate the sign.
496-
497- <P>Note that many properties that allow a number or integer as value
498- actually restrict the value to some range, often to a non-negative
499- value.
484+ name="value-def-integer" class="value-def"><integer></a></span>)
485+ or real number values (denoted by <span class="index-def"
486+ title="<number>::definition of"><a name="value-def-number"
487+ class="value-def"><number></a></span>). Real numbers and
488+ integers are specified in decimal notation only. An <integer>
489+ consists of one or more digits "0" to "9". A <number> can either
490+ be an <integer>, or it can be zero of more digits followed by a
491+ dot (.) followed by one or more digits. Both integers and real numbers
492+ may be preceded by a "-" or "+" to indicate the sign.
493+
494+ <P>Note that many properties that allow an integer or real number as a
495+ value actually restrict the value to some range, often to a
496+ non-negative value.
500497
501498<H3><A NAME="length-units">Lengths</A></H3>
502499
@@ -565,9 +562,9 @@ than the font size of the H1 elements. On the other hand:
565562the font size inherited by H1 elements.
566563</div>
567564
568- <P>When specified for the root element (e.g., HTML or BODY in HTML),
569- 'em' and 'ex' refer to the property's <a
570- href="cascade.html#initial-value">initial value</a>.
565+ <P>When specified for the root of the <a href="conform.html#doctree">
566+ document tree</a> (e.g., HTML or BODY in HTML), 'em' and 'ex' refer to
567+ the property's <a href="cascade.html#initial-value">initial value</a>.
571568
572569<P>Please consult the section on <a href="visudet.html#line-height">line
573570height calculations</a> for more information about line heights
@@ -633,15 +630,19 @@ immediately followed by a number immediately followed by '%'.
633630
634631<P> Percentage values are always relative to another value, for
635632example a length unit. Each property that allows percentage units also
636- defines to which value the percentage refers.
637-
638- <div class="example"><P>
639- Since child elements inherit the <a
640- href="cascade.html#computed-value">computed values</a>
641- of their parent, in the following example, the children
642- of the P element will inherit a value of 12pt for
643- <span class="propinst-line-height">'line-height'</span> (i.e., 12pt),
644- not the percentage value (120%):
633+ defines to which value the percentage refers. When a percentage value
634+ is set for a property of the root of the <a
635+ href="conform.html#doctree">document tree</a> and the percentage is
636+ defined as referring to the inherited value of some property X, the
637+ resultant value is the percentage times the <a
638+ href="cascade.html#initial-value">initial value</a> of property X.
639+
640+ <div class="example"><P> Since child elements inherit the <a
641+ href="cascade.html#computed-value">computed values</a> of their
642+ parent, in the following example, the children of the P element will
643+ inherit a value of 12pt for <span
644+ class="propinst-line-height">'line-height'</span> (i.e., 12pt), not
645+ the percentage value (120%):
645646
646647<PRE>
647648 P { font-size: 10pt }
@@ -682,12 +683,13 @@ For example:
682683</PRE>
683684</div>
684685
685- <P> The format of a URI value is 'url(' followed by optional white
686- space followed by an optional single quote (') or double quote (")
687- <!-- " --> character followed by the URI itself, followed by an
688- optional single quote (') or double quote (") <!-- " --> character
689- followed by optional whitespace followed by ')'. Quote characters that
690- are not part of the URI itself must be balanced.
686+ <P> The format of a URI value is 'url(' followed by optional <a
687+ href="#whitespace">whitespace</a> followed by an optional single quote
688+ (') or double quote (") <!-- " --> character followed by the URI
689+ itself, followed by an optional single quote (') or double quote (")
690+ <!-- " --> character followed by optional whitespace followed by
691+ ')'. Quote characters that are not part of the URI itself must be
692+ balanced.
691693
692694<P> Parentheses, commas, whitespace characters, single quotes (') and
693695double quotes (") <!-- " --> appearing in a URI must be escaped with a
@@ -760,8 +762,9 @@ removes any dependencies on the color depth of the display.
760762<P> The format of an RGB value in the functional notation is 'rgb('
761763followed by a comma-separated list of three numerical values (either
762764three integer values in the range of 0-255, or three percentage
763- values, typically in the range of 0.0% to 100.0%) followed by
764- ')'. Whitespace characters are allowed around the numerical values.
765+ values, typically in the range of 0.0% to 100.0%) followed by ')'. <a
766+ href="#whitespace">Whitespace</a> characters are allowed around the
767+ numerical values.
765768
766769<P>Values outside the device gamut should be clipped. For a device
767770whose gamut is sRGB, the three rules below are equivalent:
@@ -792,53 +795,72 @@ details. Note that only colors specified in CSS are affected; e.g.,
792795images are expected to carry their own color information.
793796
794797<H3>Angles</H3>
795- <P>Angle units (denoted by <span class="index-def"
798+ <P>Angle values (denoted by <span class="index-def"
796799title="<angle>::definition of"><a
797800name="value-def-angle"><angle></a></span> in the text) are used
798801with <a href="./aural.html">aural cascading style sheets</a>.
799802
800- <P>These following are legal angle units:</p>
803+ <P>Their format is an optional sign character ('+' or '-', with '+'
804+ being the default) immediately followed by a <span class="index-inst"
805+ title="<number>"><span
806+ class="value-inst-number"><number></span></span> immediately
807+ followed by an angle unit identifier. After a '0' number, the unit
808+ identifier is optional.
801809
802- <UL>
803- <LI>deg: degrees
804- <LI>grad: gradient
805- <LI>rad: radians
810+ <P>These following are legal angle unit identifiers:</p>
811+
812+ <ul>
813+ <li><strong>deg</strong>: degrees.
814+ <LI><strong>grad</strong>: gradient
815+ <LI><strong>rad</strong>: radians
806816</UL>
807817
808- <p>Values in these units may be negative. They should be normalized to
809- the range 0-360deg by the UA. For example, -10deg and 350deg are
810- equivalent. The angle value must be followed
811- immediately by the angle unit.
818+ <p>Angle values may be negative. They should be normalized to the
819+ range 0-360deg by the UA. For example, -10deg and 350deg are
820+ equivalent. The angle value must be followed immediately by the angle
821+ unit.
812822
813823<H3>Times</H3>
814824
815- <P>Time units (denoted by <span class="index-def" title="<time>::definition of"><a name="value-def-time"><time></a></span> in the
825+ <P>Time values (denoted by <span class="index-def" title="<time>::definition of"><a name="value-def-time"><time></a></span> in the
816826text) are used with <a href="./aural.html">aural cascading style
817827sheets</a>.
818828
819- <P>These following are legal time units:</p>
829+ <P>Their format is a <span class="index-inst"
830+ title="<number>"><span
831+ class="value-inst-number"><number></span></span> immediately
832+ followed by a time unit identifier. After a '0' number, the unit
833+ identifier is optional.
834+
835+ <P>The following are legal time unit identifiers:</p>
820836
821837<UL>
822- <LI>ms : milliseconds
823- <LI>s : seconds
838+ <LI><strong>ms</strong> : milliseconds
839+ <LI><strong>s</strong> : seconds
824840</UL>
825841
826842<p>Time values may not be negative. The time value must be followed
827843immediately by the time unit.
828844
829845<H3>Frequencies</H3>
830846
831- <P>Frequency units (denoted by <span class="index-def"
847+ <P>Frequency values (denoted by <span class="index-def"
832848title="<frequency>::definition of"><a
833849name="value-def-frequency"><frequency></a></span> in the text)
834850are used with <a href="./aural.html">aural cascading style
835851sheets</a>.
836852
837- <p>There are two legal frequency units:</p>
853+ <P>Their format is a <span class="index-inst"
854+ title="<number>"><span
855+ class="value-inst-number"><number></span></span> immediately
856+ followed by a frequency unit identifier. After a '0' number, the unit
857+ identifier is optional.
858+
859+ <p>There are two legal frequency unit identifiers:</p>
838860
839861<ul>
840- <li>Hz : Hertz
841- <li>kHz: kilo Hertz
862+ <li><strong>Hz</strong> : Hertz
863+ <li><strong> kHz</strong> : kilo Hertz
842864</ul>
843865
844866<div class="example"><P>
@@ -859,18 +881,19 @@ information.
859881
860882<P>When CSS is embedded in HTML, it shares the <tt>charset</tt>
861883parameter used to transmit the enclosing HTML document. As with HTML,
862- the value of the charset parameter is used to convert from the transfer
863- encoding to the document character set, which is specified by <a
864- rel="biblioentry" href="./refs.html#ref-ISO10646">[ISO10646]</a>.
884+ the value of the <tt>charset</tt> parameter is used to convert from
885+ the transfer encoding to the document character set, which is
886+ specified by <a rel="biblioentry"
887+ href="./refs.html#ref-ISO10646">[ISO10646]</a>.
865888
866889<H2><a name="css-by-itself">CSS as a stand-alone file</a></H2>
867890<!-- Add reference to rfc2045? -->
868891
869892<p>CSS style sheets may exist in files by themselves, being linked
870893from the document. In this case, the CSS files are served with the
871- media type <tt>text/css</tt>. As with all text media types, a charset
872- parameter may be added which is used to convert from the transfer
873- encoding to <a rel="biblioentry"
894+ media type <tt>text/css</tt>. As with all text media types, a
895+ <tt>charset</tt> parameter may be added which is used to convert from
896+ the transfer encoding to <a rel="biblioentry"
874897href="./refs.html#ref-ISO10646">[ISO10646]</a>.
875898
876899<h2><a name="char-escapes">Character escapes in CSS</a></h2>
0 commit comments