O'Reilly logo

CSS Quick Syntax Reference by Mikael Olsson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 25

image

Media

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

Unfortunately, the media type ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required