Export (0) Print
Expand All

@media

Sets the media types for a set of rules in a STYLESHEET object.

@media sMediaType { sRules }

sMediaType

String that specifies one of the following media types:

all

Output is intended for all devices.

print

Output is intended for printed material and for documents viewed in Print Preview mode.

screen

Output is intended for computer screens.

sRules

String that specifies one or more rules in a style sheet.

The rule has no default value.

In the following example, the @media rule is used to specify the font-size property of the BODY element for two media types:

// For computer screens, the font size is 12pt.
@media screen {
   body {font-size:12pt;}
}
// When printed, the font size is 8pt.
@media print {
   body {font-size:8pt;}
}

Community Additions

ADD
Show:
© 2014 Microsoft