W3C home > Mailing lists > Public > www-style@w3.org > April 2001

Re: New CSS working draft: media queries

From: Rijk van Geijtenbeek <rijk@iname.com>
Date: Sun, 8 Apr 2001 21:59:32 +0200
Message-ID: <15418014747.20010408215932@iname.com>
To: www-style@w3.org
[..]

BB> [1] http://www.w3.org/TR/css3-mediaqueries/

At the end of section 5 I read:
 "The keywords "only" and "not" are allowed in the media query as a
way to avoid that legacy User Agents apply the style sheet without the
device fulfilling the other conditions of the media query. This will
work since "only" and "not" are not media types in HTML4."

This makes it possible for those well schooled in Boolean logic to
compose stylesheets that are backwards compatible.

Assume...

@media print and (height < 5in) {
  IMG { display: none }
}

... this would prevent IMG to get printed on paper smaller as 5in in
supporting browsers. To prevent this rule from applying to *all* page
sizes in CSS2 browsers, you would need to add something like...

@media not print and (height < 5in) {
  IMG { display: inherit }
}

There's only one problem with this idea (besides the fact that most
web designers do not seem to be schooled in any kind of logic): the
current way browsers parse stylesheets is not compatible with the new
draft. So they will apply none of these rules. I tested

  @media screen and (min-width: 400px) {...}

and it did not get applied by any browser (IE6 beta, Opera 5.02,
Mozilla 0.7) I have installed.

A simple nonsensical case like

  @media screen x {...}

was applied by Opera, but not by the other browsers.

  
Greetings,
 Rijk                            mailto:rijk@iname.com

Mot du Jour:
Breathing may be hazardous to your health.
Received on Sunday, 8 April 2001 15:57:53 GMT

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