@media Rule

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 propertiesInternet Link.

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:
Version data is listed when the mouse hovers over a link, or the link has focus.
STYLE

See Also

media

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.