W3C home > Mailing lists > Public > www-style@w3.org > August 1997

@page and @media vs. @import

From: Liam Quinn <liam@htmlhelp.com>
Date: Mon, 04 Aug 1997 23:09:37 -0400
Message-Id: <3.0.2.32.19970804230937.0089b740@undergrad.math.uwaterloo.ca>
To: www-style@w3.org
-----BEGIN PGP SIGNED MESSAGE-----

Now that I've bothered you all enough about WD-acss, it's time to move on 
to WD-print [1]...

I'm not sure how CSS1's @import relates to @page and @media with regard to 
the requirement that "all '@import' statements must occur at the start of 
a style sheet, before any declarations." [2]  @page and @media are not 
declarations, but they contain declarations.  Must @import statements 
therefore occur before any @page and @media statements?

As well, can @import be used within @media?  Could you have a style sheet 
like the following:

@media print {
  @import url(print.css);
  BODY { font-family: Times, serif }
}
@media screen {
  @import url(screen.css);
  BODY { font-family: Verdana, sans-serif }
}

As a side issue:  Is the syntax @import "screen.css"; (i.e., without the 
url() notation) valid?  The CSS1 grammar [3] gives [STRING|URL] under 
'import' and one example [4] in the spec offers @import "subs.css";, but 
elsewhere only @import url(foo.css); is used.  If both are valid, why?

Finally, are there any requirements on where @media can occur in a style 
sheet?  Could you use

BODY { font-family: Verdana, sans-serif }
@media screen {
  BODY { background: aqua; color: black }
}
H1 { text-align: center }
@media screen {
  H1 { text-decoration: blink !important } /* hehe */
}

?

[1] http://www.w3.org/TR/WD-print
[2] http://www.w3.org/TR/REC-CSS1#the-cascade
[3] http://www.w3.org/TR/REC-CSS1#appendix-b
[4] http://www.w3.org/TR/REC-CSS1#forward-compatible-parsing

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQB1AwUBM+aZcA/JhtXygIx1AQGZdwMAlb9zHWYAXVenzlK7gXAFAYf9z1rYMXG4
mXh9PIpUKSx2EHIOBnWSASpoILMazRr7564bBElMxKttXaOquBf3cwu38meyMEfe
Me6HIpwSOk23hz2YnJVL502hFu7KiEGH
=vVA5
-----END PGP SIGNATURE-----

Liam Quinn
===============  http://www.htmlhelp.com/%7Eliam/  ===============
Web Design Group            Enhanced Designs, Web Site Development
http://www.htmlhelp.com/    http://enhanced-designs.com/
======  PGP Key at http://www.htmlhelp.com/%7Eliam/pgp.html  =====
Received on Monday, 4 August 1997 23:08:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:51 GMT