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