Re: [css3-mediaqueries] Width/Height Clarifications

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 UTC