11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22<html lang="en">
3- <!-- $Id: cascade.src,v 2.12 1998-03-14 23:30:05 ijacobs Exp $ -->
3+ <!-- $Id: cascade.src,v 2.13 1998-03-15 22:44:21 bbos Exp $ -->
44<HEAD>
55<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66<TITLE>Assigning property values, Cascading, and Inheritance</TITLE>
@@ -29,22 +29,24 @@ on the following mechanisms (in order of precedence):</p>
2929
3030<ol>
3131<li>If the <a href="#cascade">cascade</a> results in a value,
32- use it. If the value is 'inherit', use the value of the parent
33- element.
32+ use it. <!-- If the value is 'inherit', use the value of the parent
33+ element. -->
3434
35- <li>Otherwise, if the value is <a href="#inheritance">inherited</a>,
36- use it.
35+ <li>Otherwise, if the property is <a
36+ href="#inheritance">inherited</a>, use the value of the parent
37+ element, usually the actual value.
3738
3839<li>Otherwise use the property's <span class="index-def"
3940title="initial value">initial value</span>. The <a
4041name="initial-value">initial value</a> of each property is indicated
4142in the property's definition.
4243</ol>
4344
44- <P>The root of the <a href="conform.html#doctree">document tree</a>
45- cannot use values from the parent element since it has no parent. As a
46- substitute, the initial value should be used whenever the root element
47- needs a value from a parent element.
45+ <P>Since it has no parent, the root of the <a
46+ href="conform.html#doctree">document tree</a> cannot use values from
47+ the parent element; in this case, the initial value is used if
48+ necessary.
49+
4850
4951<h3><span class="index-def" title="computed value">
5052<a name="computed-value">Computed values</a>
@@ -55,11 +57,16 @@ needs a value from a parent element.
5557relative to another value, as in 'red' or '2mm') or relative (i.e.,
5658they are specified relative to another value, as in 'auto', '2em', and
5759'12%'). For absolute values, no computation is needed to find the
58- computed value. Relative values, on the other hand, must be
59- transformed into computed <a href="syndata.html#values">values</a>
60- as described in the chapter on <a href="syndata.html">syntax</a>.
61- Each property defines the meaning of that property's percentage
62- values.
60+ computed value.
61+
62+ <p>Relative values, on the other hand, must be transformed into
63+ computed values: percentages must be multiplied by the referenced
64+ actual value (each property defines which value that is), values with
65+ relative units (em, ex, px) must be made absolute by multiplying with
66+ the appropriate font or pixel size, 'auto' values must be computed by
67+ the formulas given with each property, certain keywords ('smaller',
68+ 'bolder', 'inherit') must be replaced according to their definitions.
69+
6370
6471<h3><span class="index-def" title="actual value">
6572<a name="actual-value">Actual values</a></span></h3>
@@ -73,8 +80,8 @@ applied.
7380
7481
7582<P>In most cases, elements inherit actual values. However, there are
76- some properties whose specified or calculated values may be inherited
77- (e.g., a number value for the <span
83+ some properties whose specified or computed values may be inherited
84+ (e.g., the number value for the <span
7885class="propinst-line-height">'line-height'</span> property). The
7986definition of a property whose actual value is not what other elements
8087inherit will clearly say so.
@@ -108,20 +115,23 @@ class="propinst-vertical-align">'vertical-align'</span>.
108115
109116<H2><a name="inheritance">Inheritance</a></h2>
110117
111- <P>Some actual values are inherited by the children of an element in
112- the <a href="conform.html#doctree">document tree</a>.
118+ <P>Some values are inherited by the children of an element in
119+ the <a href="conform.html#doctree">document tree</a>. Each property <a
120+ href="about.html#property-defs">defines</a> whether it is inherited or
121+ not.
113122
114- <P>All properties accept the 'inherit' keyword. For an inherited
123+ <!--< P>All properties accept the 'inherit' keyword. For an inherited
115124property, this value is merely an explicit statement of the
116125inheritance. For a property that is not inherited according to its
117126definition, this value forces inheritance.
127+ [Already in next section. BB] -->
118128
119129<div class="html-example"><P>
120130Suppose there is an H1 element with an emphasizing element (EM)
121131inside:</p>
122132
123133<PRE>
124- <H1>The headline <EM>is</EM> important!</H1>
134+ <H1>The headline <EM>is</EM> important!</H1>
125135</PRE>
126136
127137<P>If no color has been assigned to the EM element, the emphasized
@@ -135,7 +145,8 @@ class="propinst-font-family">'font-family'</span> and <span
135145class="propinst-font-size">'font-size'</span>.
136146-->
137147
138- <P>The root of the document tree cannot inherit values.
148+ <!-- <P>The root of the document tree cannot inherit values.
149+ [Already stated under "specified values". BB]-->
139150
140151<P> To set a "default" style property for a document, authors may set
141152the property on the root of the document tree. In HTML, for example,
@@ -149,22 +160,25 @@ property is inherited, all descendants of the BODY element will
149160inherit the color 'black':
150161
151162<PRE>
152- BODY { color: black; }
163+ BODY { color: black; }
153164</PRE>
154165
166+ <!--
155167<P>Not all style properties are inherited, for example <span
156168class="propinst-background">'background'</span>. But in the case of
157169<span class="propinst-background">'background'</span>, the <em>visual
158170effect</em> may be propagated to descendants. A
159171background specified for the root element, as in:</p>
160172
161173<PRE>
162- BODY { background: url(texture.gif) white; }
174+ BODY { background: url(texture.gif) white; }
163175</PRE>
164176
165177<P>will shine through any descendants unless they specify a value for
166178<span class="propinst-background-color">'background-color'</span>
167179other than 'transparent' (the initial value).
180+
181+ [Why explain that here? BB]-->
168182</div>
169183
170184<div class="example"><P>
@@ -174,16 +188,16 @@ specified</a> percentage values are not inherited; only
174188the style sheet:
175189
176190<pre>
177- BODY { font-size: 10pt }
178- H1 { font-size: 120% }
191+ BODY { font-size: 10pt }
192+ H1 { font-size: 120% }
179193</pre>
180194
181195<p>and the document fragment:
182196
183197<pre class="html-example">
184- <BODY>
185- <H1>A <EM>large</EM> heading</H1>
186- </BODY>
198+ <BODY>
199+ <H1>A <EM>large</EM> heading</H1>
200+ </BODY>
187201</pre>
188202
189203<p>The <a href="#computed-value">computed value</a> of the <span
@@ -212,6 +226,47 @@ element's parent.
212226http://lists.w3.org/Archives/Member/w3c-css-wg/1998JanMar/0054.html
213227-IJ -->
214228
229+ <H2><a name="at-import">The @import rule</a></h2>
230+
231+ <P>The <span class="index-def"
232+ title="@import"><dfn>'@import'</dfn></span> rule allows users to import
233+ style rules in other style sheets. The '@import' keyword must be
234+ followed by the URI of the style sheet to include. Any @import rules
235+ must precede all rule sets in a style sheet.
236+
237+ <div class="example"><P>
238+ Both of these import rules are valid; the
239+ first one illustrates that the "url()" syntax may be replaced by a
240+ string in the
241+ @import rule:</p>
242+
243+ <PRE>
244+ @import "mystyle.css";
245+ @import url(herstyle.css);
246+ </PRE>
247+ </div>
248+
249+ <p>So that user agents can avoid retrieving resources for unsupported
250+ <a href="media.html">media types</a>, authors may specify
251+ media-dependent <span class="index-inst"
252+ title="@import">@import</span> rules. These <span class="index-def"
253+ title="conditional import|media-dependent import">conditional
254+ imports</span> specify comma-separated media types after the URI.
255+
256+ <div class="example">
257+ <p>The following rules have the same effect as if the imported style
258+ sheet were wrapped in an @media rule for the same media, but it may
259+ save the UA a fruitless download.
260+
261+ <pre>
262+ @import url(fineprint.css) print;
263+ @import url(bluish.css) projection, tv;
264+ </pre>
265+ </div>
266+
267+ <p>In the absence of any media types, the import is
268+ unconditional. Specifying 'all' for the medium has the same effect.
269+
215270<H2><a name="cascade">The cascade</a></h2>
216271
217272<P>Style sheets may have three different origins: author, user, and
0 commit comments