© Mikael Olsson 2019
Mikael OlssonCSS3 Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4903-1_25

25. Media

Mikael Olsson1 
(1)
Hammarland, Finland
 
CSS provides a way to present documents differently, depending on the device on which they are viewed. Such conditional style rules are placed within a media rule, which consists of @media, followed by an expression that limits the scope and a set of curly brackets that encloses the conditional style rules.
@media screen {
  /* screen devices only */
}

Media Types

The media type condition, which was introduced in CSS 2, lists the following valid values, including the default value all for targeting all device types:
all | aural | braille | handheld | print | projection | screen | tty | tv | embossed ...

Get CSS3 Quick Syntax Reference: A Pocket Guide to the Cascading Style Sheets Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.