Sets the media types for a set of styleSheet rules.
Syntax
HTML @media sMediaType { sRules } Scripting N/A
Possible Values
sMediaType
screen Output is intended for computer screens. Output is intended for printed material and for documents on screen viewed in Print Preview mode. all Applies to all devices. sRules One or more rules in a styleSheet object. The rule has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.
Example
This example shows how to implement the @media rule.
Sample Code
// 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;} }
Applies To
STYLE
See Also
media