Click to return to the DHTML, HTML     
@import Rule     ACCESSKEY Attribute | acc...     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

@media Rule


Sets the media types for a set of styleSheet rules.

Syntax

HTML @media sMediaType { sRules }
ScriptingN/A

Possible Values

sMediaType
screenOutput is intended for computer screens.
printOutput is intended for printed material and for documents on screen viewed in Print Preview mode.
allApplies to all devices.
sRulesOne 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

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
STYLE

See Also

media


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.