Home / Articles / Adobe Dreamweaver / Style Your Website for Multiple Devices Using Dreamweaver CS5.5

Style Your Website for Multiple Devices Using Dreamweaver CS5.5

Contents

  1. Preview Your Pages in Multiscreen Preview
  2. Set Up Media Queries to Style for Different Devices
  3. Preview and Edit the CSS for Your Pages in Different Screen Resolutions
  4. Summary

Article Description

To get a site to work properly across multiple devices used to be more a challenge than it is today. For instance, Adobe Dreamweaver CS5.5 has built-in tools that help you design for multiple devices including personal computers, tablets, and phones. In this article, Adobe expert Brian Wood shows you how to use CSS3 media queries, Multiscreen Preview, and various other tools, to easily take your design and get it to work on different devices.
Preview and Edit the CSS for Your Pages in Different Screen Resolutions

Preview and Edit the CSS for Your Pages in Different Screen Resolutions

Next, you will copy the styling from your main style sheet (ours is meridien.css) to the phone and tablet style sheets. Then you will edit the styling to match your design tastes.

  1. Open the CSS Styles panel (Window > CSS Styles). Make sure that the sitewide.css is listed last—at the bottom of the list (you may need to toggle the arrows to the left of the style sheet names list to hide their styles). You can drag the style sheet names up or down in the CSS Styles panel, if necessary (see Figure 16). The reason why is because you want the main styling applied first, and then the device styling (the styling from sitewide.css). That way, the device styling can override the main styling.
  2. Figure 16 Make sure that the sitewide.css file is listed after your main CSS styling.

  3. Click the name of your main style sheet in the Related Files toolbar to see the CSS code (ours is called meridien.css). Insert the cursor in the CSS that appears, then choose Edit > Select All, and then Edit > Copy.
  4. Click tablet.css in the Related Files toolbar to see the code. Insert the cursor after @charset “UTF-8”; and choose Edit > Paste (see Figure 17). Choose File > Save to save the code.
  5. Figure 17 Copy and paste styling from the main style sheet to your tablet.css.

  6. Click phone.css in the Related Files toolbar to see the code. Insert the cursor after @charset “UTF-8”; and choose Edit > Paste. Choose File > Save to save the code.

Edit the Formatting for Each Device

You now have three style sheets with the same formatting. You need to go in to each and edit the formatting to suit the particular devices.

  1. Click the Design view button in the Document toolbar.
  2. Click the arrow to the right of the Multiscreen Preview button, and you will see a list of device sizes. Choose 320x480 Smart Phone to see the page in that size viewing area (see Figure 18). When you choose a device resolution from that menu, Dreamweaver applies the correct style sheet to the Design view depending on what you choose. You can now edit and preview the site right in Design view as if you were looking at it on the device!
  3. Click the arrow to the right of the Multiscreen Preview button again and choose Orientation Landscape to see what it looks like in a landscape orientation. Choose Orientation Portrait from that same menu to return to the default view.

Figure 18 View the page in Design view in a smartphone-sized viewport.

Edit the Styles

Unfortunately, I cannot tell you what styles to edit, but I can show you the process by which you can edit them:

  1. In Design view, Cmd+Opt+click (Mac OS) or Ctrl+Alt+click (Windows) some content on your page to see the Code Navigator. Notice that the phone.css is listed beneath the main style sheet (see Figure 19). Essentially, you have two of the same style applied to the page now. This is to simply safeguard against the fact that not all devices and browsers recognize media queries yet. The original styles (meridien.css for us) is applied first, and then the device styles (phone.css in this case for us). If you edit one of the phone.css styles, it will override the meridien.css styles (your original styles).
  2. Figure 19 Edit the phone.css using Code Navigator.