HTML and CSS Reference
In-Depth Information
has already been downloaded. This rule is most useful for targeting
devices with small amounts of CSS.
/* style rules for all media */
@media all {
body {
body:#ddd;
color:#666;
}
}
/* style rules for print only */
@media print {
body {
body:#fff;
color:#000;
}
}
/* style rules for handheld and projection only */
@media handheld, projection {
body {
body:#000;
color:#fff;
}
}
Although you can have an
@import
rule inside a linked style sheet or an
@media
rule inside either type of linked style sheet document, it is not
legal to nest an
@media
rule inside another
@media
rule. If you were to
define a media type with
@media
or
@import
inside an already restricted
block of code, the new media type would further restrict the targeted
media list.