Adobe Dreamweaver

Editing CSS Layouts in Dreamweaver CS5

CSS Layouts make it easy to create new page designs

Dreamweaver CS5 includes a new collection of CSS layouts which you can customize to create a variety of Web page designs. These layouts are designed to work well in a variety of Web browsers, so they can help you avoid common problems caused by the different ways Web browsers display CSS. Starting with a CSS layout gives you a great head start when creating new designs in Dreamweaver. This tutorial will help you edit those layouts to make them your own.

1. CREATE A NEW PAGE USING THE NEW DOCUMENT WINDOW
To use a CSS Layout in Dreamweaver, create a new document by choosing File>New. Then choose Blank Page from the left column and HTML from the Page Type column in the middle. Choose one of the more advanced options, such as ASP.NET, PHP, or ColdFusion, only if you’re working on a dynamic site. (If you’re not familiar with these technologies, stick with HTML.) From the Layout section on the right, click to select a CSS layout and a preview of the layout is displayed in the top right of the dialog box.

CREATE A NEW PAGE USING THE NEW DOCUMENT WINDOW

2. CHOOSING BETWEEN FIXED AND LIQUID LAYOUTS
Dreamweaver includes several layouts, designed with two distinct approaches to CSS. When you create a new page with one of these layouts the first thing you must do is decide which type you want to use. Essentially you have two options: Liquid layouts are designed to expand and contract depending on the size of the browser window. Fixed layouts are centered within the browser and set to a width of 960 pixels. Although there are some advantages to the flexibility of liquid layouts, you will have more design control with fixed layouts. I chose: 2 Column fixed, left sidebar, header and hooter.

SPECIFY HOW TO SAVE THE STYLES

3. SPECIFY HOW TO SAVE THE STYLES
When you save a CSS Layout, Dreamweaver creates all of the CSS styles to create the layout as it creates the page. You can choose to save the styles in an internal style sheet or an external one. The Layout CSS drop-down list includes three options: 1. Add to Head, creates an internal style sheet with all of the styles saved in the Head area of the file. 2. Create New File, saves all of the styles in a new external style sheet linked to the page. 3. Link to Existing File, lets you add the styles to an existing external style sheet.

CREATE AND SAVE THE NEW PAGE AND STYLES

4. CREATE AND SAVE THE NEW PAGE AND STYLES
Click Create to save the page and open it in the main workspace. With the new page open, choose File>Save to save the page and the corresponding styles at the same time. If you save the styles in an external style sheet, a second box prompts you to save the style sheet separately. If the styles are contained in an internal style sheet, they’re saved automatically when you save the page. It’s also good practice to add a page title as soon as you create a new page so you don’t forget to replace the words Untitled Page in the title field.

EDITING THE TEXT IN A PAGE CREATED WITH A CSS LAYOUT
5. USING THE CSS STYLES PANEL TO EDIT STYLES
When you work with CSS Layouts, the style information is saved in and internal or external style sheet. Either way, you can edit the styles in Dreamweaver’s CSS Styles panel. Choose Window>CSS Styles to open the panel. Make sure you have the All button selected at the top of the CSS Styles panel to view all of the styles. Click the plus (+) sign (on Windows) or the triangle (on a Mac) next to the style sheet name to open the style sheet and can view the list of style names.

USING THE CSS STYLES PANEL TO EDIT STYLES

6. USING THE CSS STYLES PANEL TO EDIT STYLES
When you work with CSS Layouts, the style information is saved in and internal or external style sheet. Either way, you can edit the styles in Dreamweaver’s CSS Styles panel. Choose Window>CSS Styles to open the panel. Make sure you have the All button selected at the top of the CSS Styles panel to view all of the styles. Click the plus (+) sign (on Windows) or the triangle (on a Mac) next to the style sheet name to open the style sheet and can view the list of style names.

USING THE CSS STYLES PANEL TO EDIT STYLES

7. CHANGING THE WIDTH OF A CSS LAYOUT 
The CSS layouts in Dreamweaver follow a common practice of using <div> tags as dividers, or boxes, around each element on the page and then using styles to describe how those boxes should be displayed. Each layout includes a <div> tag with a class style named .container that surrounds everything else in the layout. To change the width of the overall design, change the width in the CSS Styles panel. The fixed width CSS Layouts in version CS5 are 960 pixels wide, which is the recommended width for most pages on the Web today.

CHANGING THE WIDTH OF A CSS LAYOUT
8. USING CLASS STYLES VS ID STYLES
In versions CS3 and CS4, Dreamweaver’s layouts used a combination of Class and ID styles, but the layouts in CS5 use only Class styles. All of these layouts follow the rules of CSS, but they were created by different designers with different philosophies about CSS. ID styles can only be used once per page, and are commonly used for the container, header, and footer styles in CSS Layouts. Class styles can be used multiple times per page so they are more versatile. The designer who created the CS5 layouts preferred this option for all of the styles in these layouts.

USING CLASS STYLES VS ID STYLES

9. REVIEWING CSS STYLES
If you’re new to CSS, the layouts can be confusing at first because you can’t just change the colors or sizes of elements in the design area of Dreamweaver. You need to create new styles or edit the style that is already associated with an element to change the color, width or other formatting. A good way to start is simply by clicking on each style in the CSS styles panel to get familiar with the rules defined in style sheet. You can double click on a style name in the CSS styles panel to edit it in the CSS Rule dialog.

REVIEWING CSS STYLES

10. EDITING PAGE-WIDE SETTINGS

To edit page-wide settings, such as the background color of the page, or the main font face, size, and color of the text used throughout the page Double-click on the style named body in the CSS Styles panel. In the CSS Rule Definition dialog, select the Type category from the left to change Font settings. Select the Background category and use the color well in the Background-Color field to specify a color for the entire background of the page. If you prefer, you can enter any hexadecimal color code in the Background-Color field. Click OK to save the changes.

EDITING PAGE-WIDE SETTINGS

11. ADDING AN IMAGE TO THE HEADER
You can insert images into any section of a CSS layout just as you would any other page in Dreamweaver. To add an image into the header area, you should first delete the placeholder image with the text Insert_logo (180 x 90). You can insert an image of any size into the header area of the page. First clicking to place your cursor in the header area, then choose Insert>Image and select any image on your hard drive and click OK. If the Image Accessiblity Attributes dialog opens, enter a brief text description in the Alt field and click OK again.

ADDING AN IMAGE TO THE HEADER

12. EDITING THE SIDEBAR
You can change the color and width of the sidebar by editing the style named sidebar1. Double click on sidebar1 in the CSS Styles panel to open it in the CSS Rules dialog. Click on the Background category on the left to change the background color. To remove the background color, delete the hexadecimal color code from the Background field and leave it blank. To change the width, choose the Box category on the left, enter the width you want in the Width field, and choose a size option, such as pixels. Click Apply to preview the changes, click OK to save them.

EDITING THE SIDEBAR

13. EDITING LINK STYLES
The color, size and style of the links in the left sidebar of Dreawmeaver’s CSS layouts, are controlled by three different style rules. The top border and bottom margin are defined in the style ul.nav, the bottom border is defined in the style ul.nav li. The way the links appear in the page is defined in the style ul.nav a, ul.nav a:visited. To change the rollover effect, edit the style name: ul.nav a:hover, ul.nav a:active, ul.nav a:focus. Double click the name in the CSS Styles panel to open any of these styles in the CSS Rule dialog where you can edit it.

EDITING LINK STYLES
14. ALIGNING IMAGES AND OTHER ELEMENTS 
All of the CSS Layouts that come with Dreamweaver CS5 include styles you can use to align images and other elements to the left or right of page. To use these styles to align an image, insert the image and then select it. With the image selected, the Properties inspector at the bottom of the workspace changes to the image options. Click to open the Class drop-down list and select fltrt (to align the selected image to the right using the float right style), or fltlft (to align the selected image to the left using the float left style).

 ALIGNING IMAGES AND OTHER ELEMENTS

Leave a Reply

Your email address will not be published.

11 + 9 =