|
1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | 2 | <html lang="en"> |
3 | | -<!-- $Id: media.src,v 1.19 1997-10-29 04:39:27 ian Exp $ --> |
| 3 | +<!-- $Id: media.src,v 1.20 1997-10-29 22:30:56 bbos Exp $ --> |
4 | 4 | <HEAD> |
5 | 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
6 | 6 | <TITLE>Media types</TITLE> |
@@ -43,12 +43,14 @@ style sheets: |
43 | 43 | <UL> |
44 | 44 |
|
45 | 45 | <LI>Specify the target medium from a style sheet with the <span |
46 | | - class="index-def" title="@media">@media</span> at-rule. |
| 46 | + class="index-def" title="@media">@media</span> or <span |
| 47 | + class="index-def" title="@import">@import</span> at-rules. |
47 | 48 |
|
48 | 49 | <div class="example"><P> |
49 | 50 | <PRE> |
| 51 | + @import url(loudvoice.css) speech; |
50 | 52 | @media print { |
51 | | - /* style sheet "foo" goes here */ |
| 53 | + /* style sheet for print goes here */ |
52 | 54 | } |
53 | 55 | </PRE> |
54 | 56 | </div> |
@@ -97,8 +99,28 @@ sheet:</P |
97 | 99 | } |
98 | 100 | </pre> |
99 | 101 |
|
100 | | -<P>All @import rules in a @media block must appear before |
101 | | -the other rules in the block. |
| 102 | +<H3>The media-dependent @import rule</h3> |
| 103 | + |
| 104 | +<p>The <a href="cascade.html">@import</a> rule can be made <span |
| 105 | +class="index-inst" title="@import"><span class="index-def" |
| 106 | +title="conditional import|media-dependent |
| 107 | +import">conditional</span></span> on one or more medium types, by |
| 108 | +listing the media after the URL. Multiple media are separated by |
| 109 | +commas, as after the @media. |
| 110 | + |
| 111 | +<div class="example"> |
| 112 | +<pre> |
| 113 | +@import url(fineprint.css) print; |
| 114 | +@import url(blueish.css) projection, tv; |
| 115 | +</pre> |
| 116 | +</div> |
| 117 | + |
| 118 | +<p>This has the same effect as if the imported style sheet were |
| 119 | +wrapped in an @media rule for the same media, but it may save the UA a |
| 120 | +fruitless download. |
| 121 | + |
| 122 | +<p>In the absence of any media types, the import is |
| 123 | +unconditional. Specifying 'all' for the medium has the same effect. |
102 | 124 |
|
103 | 125 | <H2><a name="media-types">Recognized media types</a></H2> |
104 | 126 |
|
|
0 commit comments