As part of the W3C Style Activity, the W3C CSS working group has released a working draft specification for Media Queries that would apply to CSS and HTML. According to the abstract: "HTML4 and CSS2 currently support media-dependent style sheets tailored for different media types. For example, a document may use sans-serif fonts when displayed on a screen and serif fonts when printed. 'Screen' and 'print' are two of the media types that have been defined. To describe in more detail what type of devices a style sheet applies to, this document proposes media queries. A media query consists of a media type and one or more expressions to limit the scope of a certain style sheet. Among the proposed media features that can be used in expressions are 'width', 'height', and 'color'. By using media queries, content presentations can be tailored to a range of devices without changing the content itself. Finally, it is proposed that the media features described in this document should be registered in IANA's central registry for media feature vocabularies." The design team sought a solution for media queries which (1) would describe, in some detail, what kind of devices a style sheet can be applied to; (2) had a syntax compatible with the namespace reserved in HTML4; (3) adopted a syntax usable in future versions of CSS and XHTML; (4) would offer significantly more expressive power than the current solution without adding significant extra costs; (5) would use a vocabulary in line with CSS and HTML.
[April 04, 2001] "Media Queries." By Håkon Wium Lie (Opera Software) and Tantek Çelik (Microsoft Corporation), W3C CSS working group. W3C Working Draft, April 04, 2001. Latest version URL - http://www.w3.org/TR/css3-mediaqueries/.
Example: "Here is a simple example written in HTML: <link rel="stylesheet" media="screen and (color)" href="http://style.com/color">. The above example expresses that a certain style sheet (found from http://style.com/color) applies to devices of a certain media type ('screen') with certain characteristics (it must be a color screen)."
Principal references:
- "Media Queries."
- Latest version URL - http://www.w3.org/TR/css3-mediaqueries/
- W3C Style Activity
- 'www-style' mailing list archive
- "W3C Cascading Style Sheets" - Main reference page.