mozilla

Revision 20185 of @media

  • Revision slug: CSS/@media
  • Revision title: @media
  • Revision id: 20185
  • Created:
  • Creator: Rappo
  • Is current revision? No
  • Comment

Revision Content

{{template.CSSRef()}}

Summary

@media specifies the target media types (separated by commas) of a set of rules (delimited by curly braces).

Syntax

@media <media type>

<border-style> Values

all
Suitable for all devices.
braille
Intended for braille tactile feedback devices.
embossed
Intended for paged braille printers.
handheld
Intended for handheld devices (typically small screen, limited bandwidth).
print
Intended for paged material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media.
projection
Intended for projected presentations, for example projectors. Please consult the section on paged media for information about formatting issues that are specific to paged media.
screen
Intended primarily for color computer screens.
speech
Intended for speech synthesizers. Note: CSS2 had a similar media type called 'aural' for this purpose. See the appendix on aural style sheets for details.
tty
Intended for media using a fixed-pitch character grid (such as teletypes, terminals, or portable devices with limited display capabilities). Authors should not use pixel units with the "tty" media type.
tv
Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).

Examples

  @media print {
    body { font-size: 10pt }
  }
  @media screen {
    body { font-size: 13px }
  }
  @media screen, print {
    body { line-height: 1.2 }
  }

Notes

A multimodal media type is still only one media type. The 'tv' media type, for example, is a multimodal media type that renders both visually and aurally to a single canvas.

Specifications

Browser Compatibility

See Also

@media, @import, @font-face

Revision Source

<p> 
{{template.CSSRef()}}
</p>
<h3 name="Summary"> Summary </h3>
<p><code>@media</code> specifies the target media types (separated by commas) of a set of rules (delimited by curly braces).
</p>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval">@media &lt;media type&gt;
</pre>
<h3 name=".3Cborder-style.3E_Values"> &lt;border-style&gt; Values </h3>
<dl><dt>all
</dt><dd>Suitable for all devices. 
</dd><dt>braille
</dt><dd>Intended for braille tactile feedback devices. 
</dd><dt>embossed
</dt><dd>Intended for paged braille printers. 
</dd><dt>handheld
</dt><dd>Intended for handheld devices (typically small screen, limited bandwidth). 
</dd><dt>print
</dt><dd>Intended for paged material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media. 
</dd><dt>projection
</dt><dd>Intended for projected presentations, for example projectors. Please consult the section on paged media for information about formatting issues that are specific to paged media. 
</dd><dt>screen
</dt><dd>Intended primarily for color computer screens. 
</dd><dt>speech
</dt><dd>Intended for speech synthesizers. Note: CSS2 had a similar media type called 'aural' for this purpose. See the appendix on aural style sheets for details. 
</dd><dt>tty
</dt><dd>Intended for media using a fixed-pitch character grid (such as teletypes, terminals, or portable devices with limited display capabilities). Authors should not use pixel units with the "tty" media type. 
</dd><dt>tv
</dt><dd>Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).
</dd></dl>
<h3 name="Examples"> Examples </h3>
<pre>  @media print {
    body { font-size: 10pt }
  }
  @media screen {
    body { font-size: 13px }
  }
  @media screen, print {
    body { line-height: 1.2 }
  }
</pre>
<h3 name="Notes"> Notes </h3>
<p>A multimodal media type is still only one media type. The 'tv' media type, for example, is a multimodal media type that renders both visually and aurally to a single canvas.
</p>
<h3 name="Specifications"> Specifications </h3>
<ul><li> <a class="external" href="http://www.w3.org/TR/CSS21/media.html#at-media-rule">CSS 2.1</a>
</li></ul>
<h3 name="Browser_Compatibility"> Browser Compatibility </h3>
<h3 name="See_Also"> See Also </h3>
<p><b>@media</b>, <a href="en/CSS/@import">@import</a>, <a href="en/CSS/@font-face">@font-face</a>
</p>
Revert to this revision