Lietotāja rokasgrāmata Atcelt

Creating and using media queries in Dreamweaver

  1. Dreamweaver User Guide
  2. Introduction
    1. Responsive web design basics
    2. What's new in Dreamweaver
    3. Web development using Dreamweaver - An Overview
    4. Dreamweaver / Common Questions
    5. Keyboard shortcuts
    6. Dreamweaver system requirements
    7. Feature summary
  3. Dreamweaver and Creative Cloud
    1. Synchronize Dreamweaver settings with Creative Cloud
    2. Creative Cloud Libraries in Dreamweaver
    3. Using Photoshop files in Dreamweaver
    4. Work with Adobe Animate and Dreamweaver
    5. Extract web-optimized SVG files from Libraries
  4. Dreamweaver workspaces and views
    1. The Dreamweaver workspace
    2. Optimize Dreamweaver workspace for visual development
    3. Search files based on filename or content | Mac OS
  5. Set up sites
    1. About Dreamweaver sites
    2. Set up a local version of your site
    3. Connect to a publishing server
    4. Set up a testing server
    5. Import and export Dreamweaver site settings
    6. Bring existing websites from a remote server to your local site root
    7. Accessibility features in Dreamweaver
    8. Advanced settings
    9. Set site preferences for transferring files
    10. Specify proxy server settings in Dreamweaver
    11. Synchronize Dreamweaver settings with Creative Cloud
    12. Using Git in Dreamweaver
  6. Manage files
    1. Create and open files
    2. Manage files and folders
    3. Getting and putting files to and from your server
    4. Check in and check out files
    5. Synchronize files
    6. Compare files for differences
    7. Cloak files and folders in your Dreamweaver site
    8. Enable Design Notes for Dreamweaver sites
    9. Preventing potential Gatekeeper exploit
  7. Layout and design
    1. Use visual aids for layout
    2. About using CSS to lay out your page
    3. Design responsive websites using Bootstrap
    4. Creating and using media queries in Dreamweaver
    5. Present content with tables
    6. Colors
    7. Responsive design using fluid grid layouts
    8. Extract in Dreamweaver
  8. CSS
    1. Understand Cascading Style Sheets
    2. Laying out pages using CSS Designer
    3. Using CSS preprocessors in Dreamweaver
    4. How to set CSS Style preferences in Dreamweaver
    5. Move CSS rules in Dreamweaver
    6. Convert inline CSS to a CSS rule in Dreamweaver
    7. Work with div tags
    8. Apply gradients to background
    9. Create and edit CSS3 transition effects in Dreamweaver
    10. Format code
  9. Page content and assets
    1. Set page properties
    2. Set CSS heading properties and CSS link properties
    3. Work with text
    4. Find and replace text, tags, and attributes
    5. DOM panel
    6. Edit in Live View
    7. Encoding documents in Dreamweaver
    8. Select and view elements in the Document window
    9. Set text properties in the Property inspector
    10. Spell check a web page
    11. Using horizontal rules in Dreamweaver
    12. Add and modify font combinations in Dreamweaver
    13. Work with assets
    14. Insert and update dates in Dreamweaver
    15. Create and manage favorite assets in Dreamweaver
    16. Insert and edit images in Dreamweaver
    17. Add media objects
    18. Adding videos in Dreamweaver
    19. Insert HTML5 video
    20. Insert SWF files
    21. Add audio effects
    22. Insert HTML5 audio in Dreamweaver
    23. Work with library items
    24. Using Arabic and Hebrew text in Dreamweaver
  10. Linking and navigation
    1. About linking and navigation
    2. Linking
    3. Image maps
    4. Troubleshoot links
  11. jQuery widgets and effects
    1. Use jQuery UI and mobile widgets in Dreamweaver
    2. Use jQuery effects in Dreamweaver
  12. Coding websites
    1. About coding in Dreamweaver
    2. Coding environment in Dreamweaver
    3. Set coding preferences
    4. Customize code coloring
    5. Write and edit code
    6. Code hinting and code completion
    7. Collapse and expand code
    8. Reuse code with snippets
    9. Lint code
    10. Optimize code
    11. Edit code in Design view
    12. Work with head content for pages
    13. Insert server-side includes in Dreamweaver
    14. Using tag libraries in Dreamweaver
    15. Importing custom tags into Dreamweaver
    16. Use JavaScript behaviors (general instructions)
    17. Apply built-in JavaScript behaviors
    18. About XML and XSLT
    19. Perform server-side XSL transformations in Dreamweaver
    20. Performing client-side XSL transformations in Dreamweaver
    21. Add character entities for XSLT in Dreamweaver
    22. Format code
  13. Cross-product workflows
    1. Installing and using extensions to Dreamweaver
    2. In-App updates in Dreamweaver
    3. Insert Microsoft Office documents in Dreamweaver (Windows only)
    4. Working with Fireworks and Dreamweaver
    5. Edit content in Dreamweaver sites using Contribute
    6. Dreamweaver-Business Catalyst integration
    7. Create personalized email campaigns
  14. Templates
    1. About Dreamweaver templates
    2. Recognizing templates and template-based documents
    3. Create a Dreamweaver template
    4. Create editable regions in templates
    5. Create repeating regions and tables in Dreamweaver
    6. Use optional regions in templates
    7. Define editable tag attributes in Dreamweaver
    8. How to create nested templates in Dreamweaver
    9. Edit, update, and delete templates
    10. Export and import xml content in Dreamweaver
    11. Apply or remove a template from an existing document
    12. Edit content in Dreamweaver templates
    13. Syntax rules for template tags in Dreamweaver
    14. Set highlighting preferences for template regions
    15. Benefits of using templates in Dreamweaver
  15. Mobile and multiscreen
    1. Create media queries
    2. Changing page orientation for mobile devices
    3. Create web apps for mobile devices using Dreamweaver
  16. Dynamic sites, pages and web forms
    1. Understand web applications
    2. Set up your computer for application development
    3. Troubleshoot database connections
    4. Removing connection scripts in Dreamweaver
    5. Design dynamic pages
    6. Dynamic content sources overview
    7. Define sources of dynamic content
    8. Add dynamic content to pages
    9. Changing dynamic content in Dreamweaver
    10. Display database records
    11. Provide and troubleshoot live data in Dreamweaver
    12. Add custom server behaviors in Dreamweaver
    13. Building forms using Dreamweaver
    14. Use forms to collect information from users
    15. Create and enable ColdFusion forms in Dreamweaver
    16. Create web forms
    17. Enhanced HTML5 support for form elements
    18. Develop a form using Dreamweaver
  17. Building applications visually
    1. Build master and detail pages in Dreamweaver
    2. Build search and results pages
    3. Build a record insert page
    4. Build an update record page in Dreamweaver
    5. Building record delete pages in Dreamweaver
    6. Use ASP commands to modify database in Dreamweaver
    7. Build a registration page
    8. Build a login page
    9. Build a page that only authorized users can access
    10. Securing folders in Coldfusion using Dreamweaver
    11. Using ColdFusion components in Dreamweaver
  18. Test, preview, and publish websites
    1. Preview pages
    2. Preview Dreamweaver web pages on multiple devices
    3. Test your Dreamweaver site

 

Use Visual Media Queries to view and edit your web pages at different breakpoints corresponding to different screen sizes.

Media Queries is a CSS3 module that helps you design responsive websites by defining different style rules for different devices or media types. Based on these rules, content is rendered to adapt to various conditions, such as, screen sizes, browser window sizes, device sizes and orientation, and resolution.

You can add media queries using the @media rule to your CSS. Or, you can create separate style sheets for different media types and then call them using the following syntax:

<link rel='stylesheet' media='all' href='normal.css' />
<link rel='stylesheet' media='print' href='print.css' />
<link rel='stylesheet' media='screen and (min-width: 701px)' href='medium.css' />

The browser on a device checks the media query and uses the corresponding CSS file to display the web page. 

For more information, see this article.

You can add the media queries by adding the relevant code to your HTML or CSS files. In addition, Dreamweaver lets you create and manage media queries easily using:

The basic difference between these two methods is the visual aspect. If you prefer to code and then view the changes in Live view, use the CSS Designer. If you prefer to visualize your page at different breakpoints and simultaneously make design changes, Visual Media Query is a better bet.

Visual Media Query bars

Visual Media Query bars are a visual representation of the media queries present in a page. These bars help you visualize your web page at different breakpoints and how different components of your web page reflow in different viewports. While you view your page in different viewports, you can make design changes that are specific to a viewport without affecting the page design in other viewports.

Visual Media Query consists of three bars as horizontal rows, each representing a category of media query:

  •  Green: Media queries with max-width conditions
  •  Blue : Media queries with both min-width and max-width conditions
  •  Purple : Media queries with min-width conditions
Piezīme.

The media queries listed in the CSS designer panel are also prefixed with these colors.

Each category can consist of one or more media queries. If a media query condition is not defined in the document, then the corresponding visual media qurey bar, too, will not be displayed. For example, if the document does not contain min-width conditions, then the purple bar is not displayed.

The breakpoint values are indicated on the bars - min-width at the left and max-width at the right of the bar.

Breakpoint values

A. Breakpoints B. Visual Media Query bars C. Add media query icon D. Scrubber 

Hide or show Visual Media Queries

The Visual Media Query bar is visible in Live View by default. To hide the bar, use the Toggle Visual Media Queries bar in the toolbar.

Switch between breakpoints

To view your page in a specific size (breakpoint), click the corresponding media query bar. The document will snap to the breakpoint.

Alternatively, you can drag the scrubber to the required breakpoint.

To resize the view to the size of the Dreamweaver document window, do one of the following actions:

  • Double-click anywhere in the grey area at the right of the document where you see the text 'Double Click To Fit Width'. If you don't see the grey area, drag the scrubber to the left.
  • Select the Full Width option in the drop-down list at the bottom of the document window.
Resize the view
Resize the view

If you do not see this option, drag the scrubber to decrease the size of the web page.

Edit media queries visually

  1. Click the Visual Media Query bar that corresponds to the media query that you want to edit.

    Resize handles appear. For media queries that have both min and max-width values, resize handles appear on both the sides of the bar.

    Resize handles

  2. Drag the handles to the required size.

    The media queries are automatically updated with the new min-width and/or max-width values. A notification is displayed to indicate that the media query was successfully edited. If there are multiple media queries that correspond to the visual media query bar, all the media queries are updated. The number of media queries that were updated is displayed along with the success message. 

Piezīme.

To undo, press Ctrl+Z (Win) or Cmd+Z (Mac).

Alternatively, you can double-click the breakpoint values to type in the values using your keyboard. 

Add new media queries

  1. Drag the scrubber along the ruler to the required size.

  2. Click .

    Adding media queries
    Adding media queries

  3. In the pop-up that appears, the max-width option is selected by default. To specify min-width or min-max, select the appropriate option in the drop-down list and select the required units.

    Then, select a CSS source in which the media query must be added.

    If you choose to create a new CSS file, another pop-up appears. Specify the name and the path of the new CSS file and click OK.

Piezīme.

To undo, press Ctrl+Z (Win) or Cmd+Z (Mac).

Delete media queries

  1. Right-click the corresponding Visual Media Query bar.

  2. Click Delete and then click the media query that you want to delete.

  3. Click OK to confirm that you want to delete all the media queries and the associated selectors.

Piezīme.

To undo, press Ctrl+Z (Win) or Cmd+Z (Mac).

View the code for media queries

  1. Right-click the required Visual Media Query bar and hover your mouse on Go To Code.

    A list of all media queries in that particular breakpoint range along with the files in the which they are declared appears.

  2. Click the required media query to navigate to the corresponding code in Code View.

    If the Code View is not visible, the document is switched to Split view to display the code.

Adobe logotips

Pierakstieties savā kontā