CHAPTER 17

image

Targeting Styles with Media Queries

Media queries are simple conditions that test one or more of a device’s features, allowing you to tailor style rules to match the device’s capabilities. This makes it possible to deliver the same HTML to smartphones, tablets, and desktop computers, but with different styles optimized for the appropriate screen size and resolution. You specify the conditions at the same time as the media type (see “Specifying the Media Type” in the preceding chapter).

CSS3 Media Queries became a formal recommendation in June 2012. So, they’re stable and supported by the latest versions of all browsers in widespread ...

Get Beginning CSS3 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.