Professional Documents
Culture Documents
Dream Ware Unit 6
Dream Ware Unit 6
UNIT 6 DREAMWEAVER
Structure Page No.
6.0 Introduction 173 6.1 Objectives 173 6.2 Using Dreamweaver 173 6.3 Create a Site Home Page 176 6.4 Design a Page in Layout View 177 6.5 Insert Images 183 6.6 Insert Text 186 6.7 Work in Standard View 187 6.8 View the Site Files 189 6.9 Link Your Documents 190 6.10 Solutions/ Answers 192
6.0 INTRODUCTION
A Web site is a set of linked documents with shared attributes, such as related topics, a similar design, or a shared purpose. Macromedia Dreamweaver is a site creation and management tool, so you can use it to create complete Web sites, in addition to individual documents. Getting started in Macromedia Dreamweaver is as easy as opening an existing HTML document or creating a new one. Dreamweaver is a professional Web site development program. It has been developed to take advantage of the capabilities of the latest generation of browsers, making it easy for developers to use advanced features such as style sheets and dynamic HTML. It has been designed from the ground up to work the way professional Web developers /designers do. Dreamweaver speeds up site construction and streamlines site maintenance. This unit would be very concise in its description of the features of the components of Dreamweaver. To elaborate on everything would be a voluminous task that merits a full book for itself. However, this unit will introduce you to the essential elements. To get the most out of your Dreamweaver experience, you should understand the basic concepts behind the Dreamweaver work area and know how to choose options, use inspectors and panels, and set preferences that best fit your work style.
6.1 OBJECTIVES
After going through this unit you will be able to: Understand work area Set up the Site Structure Design a page in layout view Add contents to Web site Insert images / tables to a Web page
expertise. Once you get accustomed to keyboard and other shortcuts, you might like to work in a totally blank space. The figure below shows different components of the work area. The Document window displays the current document as you create and edit it. The Objects panel contains icons you click to insert objects in your document, and to change the way you work in a document. Dreamweaver provides many floating panels, such as the HTML Styles panel and the Code inspector, which enable you to work with other Dreamweaver elements. The Launcher bar contains buttons for opening and closing your most frequently used inspectors and panels. The Property inspector displays properties for the selected object or text, and lets you modify those properties. (Which properties appear in the inspector depends on the object actively selected in the document.) You would be well advised to close all the floating panel and options boxes cluttering up the work area by clicking on the X on the top right corner of the boxes. To open Dreamweaver's windows, inspectors, and panels, use the Window menu. A check mark next to an item in the Window menu indicates that the named item is currently open (though it may be hidden behind other windows). To display an item that isn't currently open, choose the item name from the menu or use its keyboard shortcut. Working in Dreamweaver Let us now start our journey into the realm of Dreamweaver. We begin with typing in a few test lines in our Design view. See how our work area has been divided into two windows, one displaying our text and the other displaying the corresponding HTML code.
174 Dreamweaver
Dreamweaver can display a document in three ways: as a Design view, as a Code view, and as a split view that shows both the design and the HTML code. (To change the view in which you are working, select a view in the Dreamweaver toolbar.) By default, Dreamweaver displays the Document window in Design view. You would be working most of the time in the design view and perform actions such as cutting, pasting, inserting pictures, tables and so on. For changing or altering the HTML / scripting side, you have to work in code view. In addition, you can work with Dreamweaver's Design view in two different waysin the Layout view and Standard view. (You select these views in the View category of the Objects panel.) In the Layout view you can design a page layout, insert graphics, text, and other media. In the Standard view, in addition to inserting graphics text and media, you can also insert layers, create frame documents, create tables, and apply other changes to your page options that are not available in the Layout view. In the exercise, you will see how to design Web pages in the layout view followed by the standard mode. Set up the Site Structure Structuring the Web site is the first step towards building the corporate Web site. Structuring includes creating a folder, which includes all our picture files, text files and database files in their respective folders included in the main folder, which also includes the home page. To better understand the concept of Structuring the Web Site, you could use the Dreamweaver tutorial file that is part of the package. In Dreamweaver's main menu choose Site > Open Site, then select Tutorial - Dreamweaver. The Tutorial - Dreamweaver site links to the Compass Site files located in the Dreamweaver 4/Tutorial folder. After selecting the local site, skip to the Create The Site Home Page section of the Dreamweaver tutorial.
Code view Code/design view Design View Code View Design View 175 Scripting Languages
Now that a site structure is set up for storing pages and assets for the Compass site, you'll create the first pagea home page for the site. As you build this page, you'll add images, text, and Flash assets; your document will contain the same design components as the completed Compass home page. Save Your Document Begin by saving the document you're working on. 1. Leave the Site window open, and click the Document window to make it active. The Site window remains open in the background. 2. Choose File > Save. 3. In the Save As dialog box, select the Compass_Site folder as the location for this document. 4. In the File Name field, type my_CompassHome.html. 5. Click Save. Notice that the document name now appears at the top of the Document window. Define the Document Page Title Though the document has a file name, notice it is still labelled Untitled Document; that is because it needs an HTML document name, or page title. Defining a page title helps site visitors identify the page they are browsing: the page title appears in the browser title bar and in the bookmark list. If you create a document without a page title, the document appears in the browser with the title Untitled Document. In this part of the tutorial, you'll title your page:
176 Dreamweaver
1. With the Document window active, choose View > Toolbar if the toolbar isn't already visible. Dreamweaver's toolbar appears above the Document window 2. In the Title field, type Compass Home Page; then click in the Document window to see the page title updated in the Document window's title bar. 3 Save your file.
In Layout view you can draw layout cells and layout tables to define the design areas of a document. This task is easier to accomplish if you prepare a sample of the page you're creating before you begin laying out a page. Look at the following sample layout to get an idea of the page layout you're creating in this section of the tutorial. There's a cell for the Compass logo, a table with three cells for site navigation buttons, a cell for another graphic, and a table for three cells that will hold text. You will draw tables and cells similar to this layout as you work in your document. First, you will draw a layout cell in which you will insert the Compass logo. 1. Click in the Document window of the my_CompassHome document to make the document active. 2. If they aren't already open, open the following work area tools: The Objects panel (choose Window > Objects), which you'll use to add objects to your document. The Property inspector (choose Window > Properties), which you will use to set properties or attributes for objects in your document. If the Property inspector isn't already expanded, click the expander arrow in the lower right corner so you can see all the property options. 3. In the Objects panel, click the Draw Layout Cell icon. 4. Move the pointer to the Document window; the mouse pointer changes to a drawing tool (looks like a small cross). Click in the upper left corner of the document, then drag to draw a layout cell. When you release the mouse, a layout cell appears in a layout table.
178 Dreamweaver
The layout table expands to fill the Document window, and defines the page layout area. The white rectangle is the layout cell you just drew. You can place additional layout cells in the gray area of the layout table. Resize Layout Cells To precisely design a page, you can set the size of cells you add in a document. You can also reposition cells in the page. 1. Click the border of the layout cell to select it. Handles appear around a selected layout cell: 2. To resize this layout cell, do one of the following: In the Property inspector for the layout cell, type 510 in the Fixed field to set the cell's width to 510 pixels, then click in the document to see the cell width change. Note: If you enter a pixel width that is larger than the width of the layout table, or that causes the cell to overlap another cell in a layout table, Dreamweaver alerts you and adjusts the cell width to a valid width. On the right side of the layout cell, drag the middle resize handle to the right until the cell is the desired width. When you release the mouse, the cell's width is displayed in the column header area along the top of the layout table. Add Multiple Layout Cells Next you will add three layout cells below the logo cell you just created. Later you will insert the page's navigation buttons in these cells. 1. In the Objects panel, click the Draw Layout Cell icon; then hold down the Control key (Windows) or Command key (Macintosh). 2. In the Document window, position the pointer below the cell you drew for the logo; then drag to draw a layout cell. Continue to hold the Control key (Windows) or Command key (Macintosh) and draw two more layout cells. Your screen should look similar to this.
Move a Layout Cell If you need to line up the cells next to each other you can resize and move the layout cells as you need. You can change the size of a layout cell by using one of its resize handles. You cannot click and drag a cell to move it to a new position. If you need to move a layout cell to reposition it in a document, follow these steps. 1. Click the border of a layout cell to select it. 2. To move the layout cell, do one of the following: Use the arrow keys. Hold down Shift and use the arrow keys to move a layout cell 5 pixels at a time. Group Cells in a Layout Table Now you will put the navigation button cells you just created into a single table. Grouping the cells into a table enables you to control the cell spacing and to easily move the cells as a group if you want to change the page layout. You will create a table for the navigation buttons that is the same width as the logo cell above it. Use Draw Layout Table to group the navigation button images. 1. In the Objects panel, click the Draw Layout Table icon. 2. In the Document window, position the pointer at the top left corner of the first navigation button cell; then drag the pointer so the table contains the three cells and is the length of the logo cell. 1. Release the mouse to see the cells grouped in a new table.
180 Dreamweaver
2. You have created a table that contains three layout cells (the white area in the table) and an empty space (the gray area in the table). Move the Layout Table You can select and move a layout table to other areas in a document. You cannot, however, move a layout table so that it overlaps another. Next you will move the table you just created a few pixels to the right to offset the alignment of the navigation buttons to the logo when they are inserted in the page. 1. In the Document window click the tab on the Layout table to move it. 2. Drag the layout table a few pixels to the right to reposition it, then drag one of the table's right resize handles to align the right sides of the logo and navigation button layout cells. Notice that as you create new tables and cells, gridlines appear outlining the layout area. You can use these gridlines to align the layout elements. Add another Layout Cell Next add a layout cell for the Learn More About graphic. 1. In the Objects panel, click the Draw Layout Cell icon. 2. In the Document window, draw a new cell in the space below the navigation button table. Your page should look similar to this:
Create a Layout Table In the last section you used cells to create a table. Now, you will see how to start with a table and add cells later. 1. In the Objects panel, click the Draw Layout Table icon. 2. Move the pointer to the Document window. In the area below the layout cell you just added, drag the pointer to the right to align with the right side of the topmost cell; then drag down to the bottom of the Document window. Draw Layout Cells in a Table Now add layout cells into which you will add text about travel locations. 1. In the Objects panel, click the Draw Layout Cell icon and move the pointer to the layout table you just drew. 2. Draw a table cell approximately one-third the space in the table. 3. Click the border of the layout cell to select it; then in the Property inspector's Fixed field, type 170 to set the cells width. 4. Draw another table cell approximately one-third the space in the table next to the first cell. 5. Click the border of the layout cell to select it; then in the Property inspector's Fixed field, type 170 to set the cells width. 6. Draw the last table cell in the remaining space in the table. Resize or move the cells to adjust the size or position of the cells as needed. Your screen should look similar to this:
182 Dreamweaver
In the Common category of the Objects panel, click the Insert Rollover Image icon. Choose Insert > Interactive Image > Rollover Image. 3. In the Insert Rollover Image dialog box, type planner in the Image Name field. This gives the image a unique name, and makes it easily identifiable in the HTML code. 4. In the Original Image field, click Browse; then navigate to MenuTripPlanner.gif and click Select (Windows) or Open (Macintosh). This tells Dreamweaver which image to display when the page first loads. 5. In the Rollover Image field, click Browse; then navigate to MenuTripPlanner_on.gif and click Select (Windows) or Open (Macintosh). This tells Dreamweaver which image to display when the pointer is over the original image. 6. Make sure the Preload Rollover Image option is selected so that the rollover images load when the page loads in the browser, ensuring a quick transition between images when a user moves the pointer over the original image. 7. Click OK to close the dialog box. The image appears in the document. 8. Resize the layout cell to fit the image. Create the other Rollover Image Now you will add rollover images for the other navigation buttons. 1. In the Document window, click in the second navigation button cell; then in the Common category of the Objects panel, click the Insert Rollover Image icon. 2. In the Insert Rollover Image dialog box, type destinations in the Image Name field to provide the image a unique name. 3. In the Original Image field, click Browse, then navigate to and select MenuDestinations.gif. 4. In the Rollover Image field, click Browse, then navigate to and select MenuDestinations_on.gif. 5. Make sure the Preload Rollover Image option is selected, then click OK to close the dialog box. 6. In the Document window, click in the third navigation button cell; then in the Objects panel's Common category, click the Insert Rollover Image icon. 7. In the Insert Rollover Image dialog box, type travellog in the Image Name field to provide the image a unique name. 8. In the Original Image field, click Browse then navigate to and select MenuTravelLogs.gif. 9. In the Rollover Image field, click Browse then navigate to and select MenuTravelLogs_on.gif.
184 Dreamweaver
10. Make sure the Preload Rollover Image option is selected, then click OK to close the dialog box. 11. Resize the two layout cells to fit the image. Preview Your Document You cannot view rollover behavior in Dreamweaver's Document window; rollover images work only in a browser. However, you can preview the document in Dreamweaver to see its browser-related functions. You do not have to save the document before you preview it. 1. Press F12 to see your document in a Web browser. Move the mouse pointer over the rollover images you created to see them change. 2. When you finish previewing the file, close the browser window. 3. Return to Dreamweaver's Document window and choose File > Save to save the changes you made to the home page.
10. In DW4_HomeText.txt select the last two lines of text, "Puget Sound Kayaking" through "Puget Sound." 11. Copy the text, then paste it in the third cell in the layout table. 12. Close DW4_HomeText.txt, then click in the my_CompassHome.html to make it the active document. Format Text You can format text in the Document window by setting properties in the Property inspector. First, select the text you want to format, and then apply the changes. You will change the font type and size of the text. 1. If the Property inspector isn't open, choose Window > Properties. 2. In the first text description layout cell, select all the text from the word "Fly," through the last word "ravioli." 3. In the Property inspector's second Format pop-up menu, which currently reads Default Font, select Verdana, Arial, Helvetica, sans-serif. 4. In the Size pop-up menu, select 2. The text in your document automatically updates to reflect the changes. 5. Repeat the above steps to select and format the text in the other two text-description layout cells. Apply Color and Style Now you will apply additional formatting changes to the text such as changing the color and style to create heading text. 1. In the first text description layout cell, select the heading text from the word "Fly" through the word "Mountains." 2. In the Property inspector, click the color picker; then move the eyedropper to the Learn More About image in the document window and select the brown color of the text in the image. 3. Still in the Property inspector, click the B icon to apply bold style to the text. 4. Repeat the above steps to apply color and style to the heading text in the other text description layout cells. 5. Press F12 to preview your page in a browser. Your page should look similar to the page below. Notice the text. There is little separation between text in one layout cell and the next, especially between the second and third cells. You will fix that in the later part of the unit. 6. Close the browser window, then click in the Document window to make it active.
186 Dreamweaver
In the Document window a border appears around the navigation button table, and the Property inspector now reflects properties for a table. Set Table Properties Now you will use the table Property inspector to clear the extra space in the navigation buttons table and to add a background color in the table. 1. In the Property inspector, click the Clear Row Heights icon. It is the top left button in the lower half of the Property inspector. The extra space is removed from the table. 2. Still in the Property inspector, click the BgColor color box icon, then use the eyedropper to select the color black. The black background color is applied to the navigation buttons table. Add Cell Padding Next, you will make changes to the cells that contain text. As you can see, the text is too close to the edges of the cells. You will add padding to the cells to leave room between the text and cells. 1. Click in the first cell in the text description table. 2. In the tag selector, click the rightmost <table> tag to select the table. 3. In the Property inspector's CellPad field, type 10 to add 10 pixels of space between the text and the table cells. 4. Click anywhere in the Document window to see the changes. 5. Save your document.
188 Dreamweaver
1. Click the title bar of the Site window to make it active. (If the Site window is not visible, choose Window > Site Files.) 2. In the Site window's Local Folder list, right-click (Windows) or Control-click (Macintosh) the my_CompassHome.html document; then in the context menu, choose Set as Home Page. 3. Click the Site Map icon in the top left area of the Site window; then in the Site Map pop-up menu, select Map and Files. The Site window now appears with two views of your local site: on the left is a site map, which graphically represents the current structure of the Compass site (with my_CompassHome.html as the home page), and on the right is a list of the local folder's contents. The my_CompassHome.html page currently has no links. You will add links to this page in the next section of this unit. Leave the Site window open for now, so that you can see how the site map gets updated as you add links to the home page.
1. In the Site window, double-click the icon for the my_CompassHome.html file in either pane. The my_CompassHome.html file becomes the active window. 2. In the Document window, click the Trip Planner image once to select it. 3. Choose Window > Properties to open the Property inspector if it isn't already open. The Property inspector displays information about the selected image. Note: The Link field contains a number sign (#), often referred to as a null or "dummy" link, created when you inserted the rollover image. Do not remove this character. It will soon be replaced with the file name of the document you link to. 4. In the Property inspector, click the folder icon to the right of the Link field. 5. In the Select File dialog box, browse to the Compass_Site folder and then to DW4_TripPlanner.html; click Select (Windows) or Open (Macintosh) to select the file to open when the Trip Planner button is clicked. The file name appears in the Link field of the Property inspector. Now you will add a link to the Destinations image using the Property inspector and the Site window. 6. Click the title bar of the Site window to make it active, or choose Window > Site Files. Resize your Document window, if necessary, so that you can position the left side of the Document window and the Site window side by side. 7. In the Document window, click the Destinations image to select it. 8. In the Property inspector, click the Drag to File icon (located to the right of the Link field), then drag the pointer to the Site window and in the Local Folder List, point to the file DW4_Destinations.html. The file name appears in the Link field in the Property inspector for the products image. 9. Click the Site Map icon in the Site window. The site map gets updated to reflect the link you just added.
190 Dreamweaver
A plus (+) sign next to any file in the site map indicates that the file contains links to other documents. Click the plus sign to expand the site map to display the associated files; click the minus (-) sign to collapse the site map. Next, you will add a link for the Travelogs image. 10. In the Document window, click the Travelogs image to select it. 11. In the Property inspector, drag the Point-to-File icon to the Site window, and point to the file DW4_Travelog.html. 12. Choose File > Save to save the changes you have made to the home page. Test Your Page You cannot test your links in Dreamweaver; you must check your links in a browser to make sure the pages operate as you expect. 1. Press F12 to preview the page in a browser. Click the navigation buttons to check your links. Click your browser's back button to return to your home page. 2. When you are finished testing your page, choose File > Close to close the page.
In the original Image field, select the image to display when the page loads. In the Rollover Image field, select the Image to display when the mouse pointer is over the original Image. Preload Rollover Image should be selected to load the rollover image when the page when the page is initially loaded to avoid delays. Click OK to close the dialog box. 192