beautypg.com

Creating media queries, Creating media queries (cs5.5 and later), Overview – Adobe Dreamweaver CC 2014 v.13 User Manual

Page 227: Create a media query

background image

Creating media queries (CS5.5 and later)

To the top

To the top

Overview
Create a media query
Use an existing media queries file
Choose a different site-wide media queries file
Viewing web pages based on media query

You can use media queries to specify CSS files based on the reported characteristics of a device. The browser on a device checks the media
query and uses the corresponding CSS file to display the web page.

For example, the following media query specifies the phone.css file for devices that are 300-320 pixels wide.

width: 320px)">

For an extensive introduction to media queries see Don Booth’s article on the Adobe Developer Center

www.adobe.com/go/learn_dw_medquery_don_en

.

For more information on media queries from the W3C see

www.w3.org/TR/css3-mediaqueries/

.

Overview

You can use media queries to specify CSS files based on the reported characteristics of a device. The browser on a device checks the media
query and uses the corresponding CSS file to display the web page.

For example, the following media query specifies the phone.css file for devices that are 300-320 pixels wide.

width: 320px)">

For an extensive introduction to media queries see Don Booth’s article on the Adobe Developer Center

www.adobe.com/go/learn_dw_medquery_don_en

.

For more information on media queries from the W3C see

www.w3.org/TR/css3-mediaqueries/

.

Create a media query

In Dreamweaver, you can create a site-wide media query file, or a document-specific media query.
Site-wide media query file Specifies display settings for all pages in your site that include the file.

The site-wide media query file acts as the central repository for all media queries in your site. After you create this file, link to it from pages in your
site that must use the media queries in the file for their display.

Document-specific media query The media query is inserted directly into the document, and the page is displayed based on the inserted media
query.

1. Create a web page.

2. Select Modify > Media Queries.

3. Do one of the following:

To create a site-wide media query file, select Site Wide Media Queries File.

To create a document-specific media query, select This Document.

4. For site-wide media query, do the following:

a. Click Specify.

b. Select Create New File.

c. Specify a name for the file, and click OK.

5. It is possible that some devices do not report their actual width. To force devices to report their actual width, ensure that the option Force

Devices To Report Actual Width is enabled.

The following code is inserted into your file when you choose this option.

220

This manual is related to the following products: