W3C home > Mailing lists > Public > www-style@w3.org > June 2008

Re: [css3-mediaqueries] Width/Height Clarifications

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 9 Jun 2008 16:14:33 -0500
Message-ID: <dd0fbad0806091414v70fa0f3bg72a6d2e5de0475de@mail.gmail.com>
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: www-style@w3.org
On Mon, Jun 9, 2008 at 2:40 PM, Andrew Fedoniouk <news@terrainformatica.com>
wrote:

> Consider following css resource:
> --- a.css ---
>   @media screen
>   {
>       a { color:green; }
>   }   --- end of a.css ---
>
> And following markup:
>
> <html>
>  <style>
>   @import url(a.css) print;
>  </style>
>  <body> <a href="#">test</a> </body>
> </html>
>
> that is loaded in UA on media screen.
>
> What color that <a> should have?
> If you say that you load and parse everything disregarding of media type
> then <a> should have  a { color:green; } applied.
> Neither Mozilla nor Opera do that as far as I can tell.


Load and parse, certainly, but not necessarily apply.  If that was the case,
media queries would be entirely useless, as you must have noted when
constructing your example.

The a.css file gets loaded on page load, but its contents are only applied
when you try to print.  So, the <a> isn't green on the screen, nor is it
green in the printout (since at that point it's wrapped in a screen query,
and thus won't apply).

~TJ
Received on Monday, 9 June 2008 23:42:27 GMT

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