Prev | Current Page 50 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

Let??™s look at a
some examples:
media="all and (color)">
href="example.css" ?>
@import url(/style.css) all and (color);
@media all and (color) {
?‹® one or more rule sets??¦
}
In the above examples, we can see media queries used in the media attribute of a
tag and an XML processing instruction, and with the optional media type
list in @import and @media at-rules. In all three examples, the media query uses the
expression all and (color) to indicate that the CSS should be applied to all output
media that are capable of representing color.
Here??™s another example that applies to hand-held devices, but only if the viewport
width is at least 20em:
What Is CSS?
15 What Is CSS?
@media handheld and (min-width:20em) {
?‹® one or more rule sets??¦
}
You can use multiple expressions in a media query if you join them with the and
keyword. The following example applies the CSS if the output device is a
screen-based device with a width between 800 and 1280 pixels:
@import url(/style.


Pages:
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62