Skip to Content
Dreamweaver CS6: The Missing Manual
book

Dreamweaver CS6: The Missing Manual

by David Sawyer McFarland
July 2012
Intermediate to advanced
1034 pages
38h 32m
English
O'Reilly Media, Inc.
Content preview from Dreamweaver CS6: The Missing Manual

Media Queries

As mentioned at the beginning of this chapter, CSS3 includes a concept called media queries, which lets you assign styles to a page based on the width and height of the destination browser. So you can create custom styles for mobile phones, tablets, and desktop browsers, and, in turn, customize your site’s presentation so that it looks its best on each type of device. Because media queries are part of the yet-to-be-finished CSS3 standard, not all browsers support them. Fortunately, the browsers you’re most interested in—those for mobile phones and tablets—do, so even though Internet Explorer 8 doesn’t know what a media query is, your good old iPhone or Android device does.

Tip

You can make IE 8 and earlier understand your media queries by adding a bit of JavaScript to the <head> of your document. You’ll need to download the respond.js file from http://tinyurl.com/7w49a6z. Put the file in your site, and then link it to your page using the <script> tag. For example:

<script src="respond.min.js"></script>

This little maneuver forces IE 8, 7, and 6 to understand media queries. In fact, Dreamweaver CS6’s new Fluid Grid Layout automatically adds this JavaScript to your pages (see Adding Styles to Media Query Style Sheets).

A “query” is just a question asked of a web browser: “Is your screen 320 pixels wide?” If the answer is Yes, the browser launches a style sheet for just that size device (a style sheet that you supply, as explained on Using Dreamweaver’s Media Queries Tool ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Dreamweaver CS4: The Missing Manual

Dreamweaver CS4: The Missing Manual

David Sawyer McFarland
Dreamweaver CC: The Missing Manual

Dreamweaver CC: The Missing Manual

Chris Grover, David Sawyer McFarland

Publisher Resources

ISBN: 9781449326999Errata Page