Section 1.3. The Dreamweaver Test Drive


1.3. The Dreamweaver Test Drive

Although reading a book is a good way to learn the ins and outs of a program, nothing beats sitting in front of the computer and taking a program through its paces. Many of this book's chapters, therefore, conclude with hands-on training: step-by-step tutorials that take you through the creation of a real, working, professionally designed Web site for the fictional online magazine the National Exasperator .

The rest of this chapter, for example, introduces Dreamweaver by taking you step by step through the process of building a Web page. It shouldn't take more than an hour . When it's over, you'll have learned the basic steps of building any Web page: creating and saving a new document, adding and formatting text, inserting graphics, adding links, and making the program work for you.

If you're already using Dreamweaver and want to jump right into the details of the program, feel free to skip this tutorial. On the other hand, this tutorial identifies some major changes in Dreamweaver 8, so you may want to take a spin, even if you're comfortable with Dreamweaver MX 2004. (And if you're the type who likes to read first and try second, read Chapters 2, 3, 4 through 5 and then return to this chapter to practice what you've just learned.)


Note: The tutorial in this chapter requires the example files from this book's Web site, www.sawmac.com/missing/dw8/. Click the Tutorials link to go to the tutorials page. Download the files by clicking the Chapter 1 link. All the tutorial files are stored as ZIP files: a type of file that compresses a lot of different files into one, smaller file. Windows owners will need a utility to "unzip" or decompress the tutorial files. Many Windows machines include just such a utility, so double-clicking the downloaded file will usually do the trick. But if your computer doesn't have a program to unzip the file, you can download a free and easy-to-use unzip utility here: http:// members .ozemail.com.au/~nulifetv/freezip/freezip.exe. Mac OS X has built-in ZIP support, so you can just double-click the file to decompress it.At any rate, after you've downloaded and decompressed the files, you should have a DWTutorial1 folder on your computer, containing the Web pages and graphics needed for this tutorial.
UP TO SPEED
Folders Worth Knowing About

During the tutorial in these pagesand, indeed, everywhere in Dreamweaveryou'll encounter a few terms frequently heard at Web designer luncheons:

  • Root folder . The first basic rule of Web design is that every piece of the site you're working onWeb page (HTML) documents, graphic images, sound files, and so onmust sit in a single folder on your hard drive. That master folder is the root folder for your Web sitein fact, it's the local root folder. ( Local means on your computer, as opposed to the copies of these Web pages that will ultimately hang on the Internet. Root means the master, outer, main folder.) Of course, to help organize your site's files, you can include any number of subfolders inside the root folder.

  • Local site . The usual routine for creating Web pages goes like this: you first create the page on your own computer, using a program like Dreamweaver; then you upload it to a computer on the Internet called a Web server, where your handiwork becomes available to the masses. In other words, almost every Web site in the universe exists in two places at once. One copy is on the Internet, where everyone can get at it. The other, original copy is on some Web designer's hard drive.

    The copy on your own computer is called the local site , or the development site. Think of the local site as a sort of staging ground, where you build your site, test it, and modify it. Because the local site isn't on a Web server and can't be accessed by the public, you can freely edit and add to a local site without affecting the pages your visitors are viewing, meanwhile, on the remote site.

  • Remote site . When you've added or updated a file, you move it from the local site to the remote site. The remote , or live, site is a mirror image of the local site. Because you create it by uploading your local site, it has the same organizational folder structure as the local site and contains the same files. Only polished, fully functional pages go online to the remote site; save the half-finished, typo-ridden drafts for your local site. Chapter 15 explains how to use Dreamweaver's FTP features to define and work with a remote site.

(If you're using Dreamweaver's database features, by the way, you'll encounter yet another term : a testing server. You'll find the lowdown on this kind of site, which is used to test database features, on Section 20.2.1.)


1.3.1. Phase 1: Getting Dreamweaver in Shape

Before you get started working in Dreamweaver, you need to make sure the program's all set up to work for you. In the following steps, you'll double-check a key Dreamweaver preference setting, and you'll organize your workspace using the new Workspace Layout feature.

First, you'll make sure the preferences are all set:

  1. If it isn't already open , start Dreamweaver .

    Hey, you've got to start with the basics, right?

  2. Choose Edit Preferences (Windows) or Dreamweaver Preferences (Mac) .

    The Preferences dialog box opens, listing a dizzying array of categories and options (see Figure 1-8).

    Figure 1-8. Dreamweaver's Preferences dialog box is a smorgasbord of choices that let you customize the program to work and look the way you want. In this step, you'll make sure Dreamweaver uses Cascading Styles Sheet code for formatting your page by turning on the "Use CSS instead of HTML tags" checkbox.
  3. In the Category list on the left side of the Preferences dialog box, click General. Make sure the checkbox "Use CSS instead of HTML tags" is turned on .

    The program offers wide support for Cascading Style Sheets, but also still supports outdated HTML tags to add formatting to text, links, and basic properties of a Web page, as described in the note on the next page.


    Note: Out of the box, Dreamweaver uses CSS (instead of the outmoded <font> tag) to format text and old-school HTML attributes to format the <body> tag.You may still want to use old HTML tags in a couple of cases: if you already have a site that uses the <font> tag religiously and you're not ready to undertake the big challenge of converting the entire site to CSS, or if you're using Dreamweaver to create an HTML email. Though many email programs can display emails formatted with CSS, to play it safe and make sure your HTML email looks good in as many email programs as possible, it's a good idea to use the old <font> tags for formatting text. To use these tags, turn off "Use CSS Instead of HTML tags," as pictured in Figure 1-8. But be careful; that approach is deprecated ( considered obsolete) by the W3C, the main Web standards organization. Future browsers may not understand those tags and attributes.
  4. Click OK .

    The dialog box closes . You're ready to get your workspace in order. As noted at the beginning of this chapter, Dreamweaver has many different windows that help you build Web pages. For this tutorial, though, you'll need only three: the Insert bar, the document window, and the Property inspector. But, for good measure (and to give you a bit of practice) you'll open a few panels as well.

  5. Make sure the Property inspector and Insert bar are open (see Figure 1-1) .

    If they aren't, choose Window Property Inspector and Window Insert Bar, respectively (see Figure 1-9).

    Figure 1-9. In the Window menu, a checkmark next to the window or panel name lets you know that it's open.
  6. If the CSS styles panel isn't open, choose Window CSS Styles .

    This panel lists stylesessentially, formatting instructions for your pagethat you've created. You'll use it frequently; it's discussed in greater detail on Section 6.2.

  7. If the Files panel isn't open, choose Window Files .

    This is another frequently encountered panel. It lists all the files in your site and provides an easy way to open, delete, and manage your Web pages.

    With the most important windows and panels open, you'll clean up your workspace by eliminating a panel group that you won't use for any of these basic tutorials.

  8. Right-click (Control-click on Mac) the empty area to the right of the Application group tab (see Figure 1-10) and from the pop-up menu, select "Close panel group."

    This closes the Application panel, which is used for the advanced, database-driven Web sites described in Part Six of this book. Your workspace is all set up now; next, you'll save this layout, so you can return to this exact same positioning of panels and windows whenever you like.


    Note: Don't worry if you make a mess of your workspace, you can always revert back to the original setup by choosing Window Workspace Layout Designer (Windows) or Window Workspace Layout Default (Mac).
  9. Choose Window Workspace Layout Save Current .

    The Save Workspace Layout window appears, waiting for you to name your new layout.

  10. Type Tutorial 1 (or any name you like) and click OK .

    You've just created a new workspace layout. To see if it works, you'll switch to Dreamweaver's original layout, see how the screen changes, and then switch back to your new setup.

  11. Choose Window Workspace Layout Designer (Default on the Mac) .

    This returns the workspace to what you see when you first install Dreamweaver; notice how the Application panel reappears and the CSS Styles panel is closed.

  12. Choose Window Workspace Layout Tutorial 1 (or whatever name you gave in step 10) .

    Voil ! Dreamweaver sets up everything the way you want it. You can create multiple layouts for different Web sites or different types of sites.

1.3.2. Phase 2: Creating a Web Site

Whenever you build a new Web site or edit an existing one, you must begin by introducing Dreamweaver to ita process called defining a site . This is the most important first step when you start using Dreamweaver, whether you plan to work on a five-page Web site, build a thousand-page online store, or edit an existing Web site.

Whenever you want to use Dreamweaver to create or edit a Web site, your first step is always to show the program where the root folder isthe master folder for all your Web site files. You do it like this:

  1. Choose Site New Site .

    The Site Definition window appears. There's a basic and an advanced method for defining a site. You'll learn the basic method first, so make sure the Basic tab is selected (see Figure 1-11).

    Figure 1-11. The Basic tab of the Site Definition window takes you step by step through the process of setting up a new site. Each stage of the processEditing Files, Testing Files, and Sharing Filesis clearly labeled. Depending on the type of site you're building, and which Dreamweaver features you plan on using, you'll be taken through a series of simple questions that help you set up your site.
  2. Type Tutorial 1 in the Site Name field .

    The name you type here is solely for your own reference, to help you identify the site in Dreamweaver's Site menu. It won't appear on the Web. Dreamweaver also asks for the Web address for your site. On a real site, you'd type an address like http://www.mysite.com/, but for this tutorial, there isn't any real Web site, and Dreamweaver works just fine when you leave this blank.

  3. Click Next .

    In the next step, you'll tell Dreamweaver whether you plan on building (a) regular Web pages or (b) pages that require a special server for creating the dynamic, database-driven Web sites discussed in Part Six of this book.

  4. Click "No, I do not want to use a server technology." Click Next .

    In this tutorial, you'll be building a basic Web page.

    In the next steps, you'll tell Dreamweaver how you want to work on the files in your site and where you'll store those files. In this example, you'll use the folder you downloaded from this book's Web site (at other times, you'll choose or create a folder of your own).

  5. Click "Edit local copies on my machine."

    Understanding why you made this choice takes a bit of explanation.

    The most common method of working on the files of a Web site involves having two sets of files: the local site on your hard drive and the remote site on the Web (see the box on Section 1.3.1).

    But there are other ways to work on Web sites. For example, if you work at a company with an in-house Web server, you may want to work directly on the online Web files over the corporate network. In fact, there's a third method: you can even edit your Web pages directly on the Internet.

    But the first method is by far the best one. Working directly on the live version of the sitethe one anyone with a Web browser can seeexposes your half-finished pages, with their typos and missing pictures, to your audience. It's a much better idea to perfect a page on your own computer, and then, when it's finished, move it to the Web server.

  6. Click the folder icon next to the label, "Where on your computer do you want to store your files?"

    The Choose Local Root Folder window opens, so that you can choose a folder on your hard drive that will serve as your local root site folder . This is the folder on your computer where you'll store the HTML documents and graphics, CSS, and other Web files that make up your Web site.

  7. Browse to and select the DWTutorial1 folder .

    The Mac and Windows versions of Dreamweaver handle this ritual a bit differently; see Figure 1-12.

    If you were starting a Web site from scratch, you could also create a new empty folder at this point. You would then save your Web pages and graphics into this folder as you built your site.

    For more on root folders and organizing Web sites, see Part Four of this book. For now, the fact to burn into your brain is that all the files that will constitute your Web site must live in the local root folder while you're working on them. (You can have subfolders with Web files inside the local root folder. You just can't have any files outside this root folder.)

    Figure 1-12. When it comes to selecting a local root folder, the Windows and Mac versions of Dreamweaver differ slightly.
    Top: In Windows, the folder name appears in the Select field at the top of the Choose Local Folder window. Click Select to define it as the local root.
    Bottom: In Mac OS X 10.3 or later, highlight a folder in the list in the middle of the window and then click Choose to set it as the local root folder.
  8. Click Next .

    Now Dreamweaver asks how you want to connect to your remote server the computer that will dish up the finished Web files to your adoring public.

  9. From the "How do you connect to your remote server?" menu, choose None; click Next .

    Dreamweaver can move your files to a Web server automatically, as you'll learn in Chapter 15.

    After clicking Next, you'll see a summary of your settings. If you made a mistake, click Back to return to the appropriate step in the process to make changes.

  10. Click Done .

    After defining the site, Dreamweaver creates a site cache for your Web site. That's a small database (cache) that tracks pages, links, images, and other components of your site. The cache helps Dreamweaver's site-management tools avoid breaking links, warn you when you're about to delete important files, and help you reorganize your site quickly. Since there are hardly any files in the DWTutorial1 folder, you may not even notice this happeningit'll go by in a blink of the eye.

    Defining a site doesn't actually do anything to your computer; it doesn't create a home page or add a folder, for example. It merely prepares Dreamweaver for working on a site.


Tip: Dreamweaver lets you define multiple Web sites, a handy feature if you're a Web designer with several clients , or if your company builds and manages more than one site. To define an additional site, choose Site New Site and follow the steps starting on Section 1.3.2. You can then switch from one site to another using the Site List in the Files panel.
  1. Choose File New .

    Although you may already have a blank document open, you should get to know the New Document dialog box (see Figure 1-13).

    Figure 1-13. The New Document dialog box appears whenever you choose File New or press Ctrl+N (-N). It lets you create a whole range of different types of documents, including basic Web pages, dynamic pages (see Part Six), style sheets (Chapter 6), and templates (Chapter 17), to name a few. Furthermore, the categories labeled CSS Style Sheets, Framesets, Page Designs (CSS), Starter Pages, and Page Designs include a bunch of readymade Web page designs.

    Tip: If you don't want to deal with this window every time you create a new page, click Preferences. In the Preferences dialog box, click the New Document category and turn off the "Show New Document Dialog on Control-N" checkbox.While you're at it, you can also specify what kind of file you want Dreamweaver to make whenever you press Ctrl+N ( -N). For example, if you most commonly create plain HTML files, choose HTML. But if you most often create dynamic pages (like the ASP.NET pages described on Section 20.1.1.2), choose a different type of fileASP.NET VB, for example.With these settings, pressing Ctrl+N ( -N) will instantly create a new blank document. (Choosing File New, however, will still open the New Document window.)

    On the General panel, highlight the Basic Page category; in the Basic page list, highlight HTML .

    You'll do one last thing before finally creating your new Web page: to be truly up to the minute with Web building techniques, you'll also use XHTML to build this page. XHTML, further described on Section 3.2.2, is the latest incarnation of HTML. The main Web standards organization, the World Wide Web Consortium (W3C), recommends it due to its compatibility with future standards and its cleaner, more logical structure. (In other words, plain-old HTML sites will theoretically become technologically obsolete before XHTML sites.)

  2. Select "XHTML 1.0 Transitional" from the Document Type (DTD) menu in the bottom right of the window .

    The window should look like Figure 1-13. There are actually several "flavors" of XHTML. The "Transitional" type will keep your pages compatible with older browsers and give you a wider range of HTML tags to work with. If you want to continue to create regular HTML pages, select "HTML 4.01 Transitional" (this is the standard type for previous versions of Dreamweaver) or "HTML 4.01 Strict."

  3. Click Create .

    Dreamweaver opens a new, blank XHTML page. Even though the underlying code for an XHTML page is different in many ways from that of a plain HTML page, you have nothing to worry about. Dreamweaver manages all that code, so you don't have to.

  4. Choose File Save .

    The Save As dialog box opens.

    Always save your pages right away. This habit prevents serious headaches if the power goes out as you finish that beautifulbut unsavedcreation.

  5. Save the page as advertise.html in the DWTutorial1 folder .

    You could also save the page as advertise.htm ; both .html and .htm are valid.

    Make sure you save this page into the correct folder. In Phase 1, you defined the DWTutorial1 folder as the root of the site: the folder that holds all the pages and files for the site. If you save the page outside of this folder, Dreamweaver will get confused , and its site management features won't work correctly.


    Note: Most operating systems let you save files with long names, spaces, and characters like #, $, and &. But some browsers and servers have trouble interpreting anything other than letters and numbers; for example, Netscape 4.x can't "see" any files with spaces in their names . Play it safe: use only letters , numbers , andif you want a good substitute for a spacethe underline or underscore character, like_this (Shift+hyphen).Furthermore, Web servers rely on file extensions like .htm, .html, .gif, and .jpg to know whether a file is a Web page, graphic, or some other type of file. Dreamweaver for Windows automatically adds the extension to your saved document names. But on the Mac, where you can save files without extensions, make sure the file ends in the suffix .html or .htm when you save a Dreamweaver document.
  6. If the document-window toolbar isn't already open, choose View Toolbars Document to display it .

    The toolbar at the top of the document window provides easy access to a variety of tasks you'll perform frequently, such as titling a page, previewing it in a Web browser, and looking at the HTML source code.

  7. In the Title field in the toolbar, select the text "Untitled Document"; type Advertise with the National Exasperator .

    The Title field lets you set a page's titlethe information that appears in the title bar of a Web browser. The page title is also what shows up as the name of your Web page when someone searches the Web using a search engine like Yahoo! or Google.


    Note: Try this simple experiment: go to www.google.com and search for Untitled Document . You'll find that the Web is strewn with thousands upon thousands of Web pages without titles, many of which were created with Dreamweaver.That's because when you create a new Web page, Dreamweaver assigns it the not-so-glamorous title "Untitled Document," and all too many people forget to change that dummy text to something more meaningful. Not only does "Untitled Document" look very unprofessional on a Web page, but an untitled page looks terrible in the results list of a search engine.
  8. On the Property inspector, click the Page Properties button, or choose Modify Page Properties .

    The Page Properties dialog box opens (see Figure 1-14), allowing you to define the basic attributes of each Web page you create. There are five categories of settings that let you control properties like background color , link colors, and page margins.

  9. From the Page font menu, select "Verdana, Arial, Helvetica, sans-serif."

    This sets a basic font (and three backup fonts, in case your visitor's machine lacks Verdana) that Dreamweaver will automatically use for all text on the page.

    As you'll see later in this tutorial, though, you can always specify a different font for selected text.

    Next, you'll set a basic text color for the page.

  10. Click the small gray box next to the "Text color" label. From the pop-up color palette, choose a white swatch .

    Unless you intervene, all Web page text starts out black in Dreamweaver. But in the next step, you'll set the background of this page to a darker color, so the text will need to be a light colorwhite, in this caseto be readable. (Here again, you can override this color on a case-by-case basis, as you'll see later in this tutorial.)


    Tip: Alternatively, you could type #FFFFFF into the box beside the palette square. That's hexadecimal notation, which is familiar to HTML coding gurus. Both the palette and the hexadecimal color-specifying field appear fairly often in Dreamweaver.
  11. Click the small gray box next to the words "Background color." Using the eyedropper cursor, select the blue-gray square pictured in Figure 1-14 .

    The numbers #669999 should appear at the top of the box. You've just changed the page background from white to bluish-gray.

    Figure 1-14. The Page Properties dialog box lets you set general properties of a Web page, like the color of text and links. Clicking a color box opens the color selector, where you can choose from the palette or use the eyedropper to sample a color from anywhere in your document window.

    Tip: You can even fill the background of your page with a graphicto add a subtle pattern for texture or to put the company logo in the background as a "watermark." Be careful with background images, however. If there's a lot of contrast and detail in your background image, it can easily obscure the rest of the content on the page.To choose a background image, click the Browse button shown in Figure 1-14. A window opens, where you can search for the graphic you want to use.You can control the placement of a background imagewhether it repeats across the entire page, or just along the top or side, and moreusing CSS. See Section 6.7.2.1 for more detail.
  12. If you want to eliminate margins from the edge of the browser window, type into the Left and Top margin boxes .

    Most browsers put a little bit of space between the contents of your Web page and the top and left sides of the browser window. The size of this margin varies from browser to browser.

    If you like, you can change this setting to make the browser add more space to the top and left side of the page, or eliminate the space altogether. In fact, you can even add a little extra empty space on the right side of a page. (The right margin control is especially useful for languages that read from right to left, like Hebrew.)

    Note, however, that the bottom margin has no effect on the page display. For this tutorial, you don't need to set any margins, but keep this discussion in mind when you start building your own pages.

  13. Click the Links category and add the following properties: in the Links color field, type #FFCC00 ; in the "Visited links" field, type #FF9900 ; in the "Rollover links" field, type #FF0000 ; and in the "Active links" color field, type FFFFCC (see Figure 1-15) .

    These are hexadecimal codes that specify specific Web page colors; more on this notation on Section 1.3.3.

    Links come in four varieties: regular, visited, active, and rollover. An active link is one you're clicking at this moment; a visited link is one you've already been to, as noted in a browser's History list. A regular link is a plain-old link, unvisited, untouched. And, finally, a rollover link indicates how the link looks when someone moves his mouse over it. You can choose different colors for each of these link states.

    Figure 1-15. You can set many different properties for links using the Links category of the Page Properties window. You can choose a different font and size for links, as well as specify colors for four different link states. Finally, you can choose whether (or when) links are underlined . Most browsers automatically underline links, but you can override this behavior with the help of this dialog box and Cascading Style Sheets (see Chapter 6).

    Note: Although Dreamweaver uses the term rollover link, in the world of Cascading Style Sheets, this is called a hover link.
    UP TO SPEED
    Using Dreamweaver's Color Box

    The innocent-looking gray box on the Property inspector, the Modify Page Properties window, and in various boxes throughout Dreamweaver is called the color box. You can use it to choose a color for the selected Web page element in any of three ways.

    First, you can click one of the colors on the pop-up rainbow palette that appears when you click the box.

    Second, you can use the eyedropper cursor that appears when you click the color box. This cursor is "loaded"; you can click any spot on your screeneven outside the dialog boxto select a color, a trick that comes in handy when you want to use a color from a graphic in your document. You can even sample a color from another application (from any visible window, Dreamweaver or not): just move the eyedropper over the color and click. (This click may take you out of Dreamweaver. Just return to Dreamweaver, and you'll see that the color you sampled has been applied.)

    Finally, you can click the Color Picker icon, identified here, to launch the Mac or Windows color-picker dialog box, which lets you choose from among millions of possible colors.

    If you decide you don't want to add color, or you want to remove a color you've already applied, click the Default Color button. Without a specific color setting, Web browsers will use default colors for the element in question. For instance, text on a Web page is usually black unless you specify otherwise .

    Next to the color box in any Dreamweaver dialog box is a blank text field. If you know your Web colors, you can type their hex codes into this box, which is sometimes faster and more precise than clicking on the rainbow palette.

    In a hex code, a Web color is represented by a six-digit code like this: #FF0000. (Hexadecimal notation is a system computers use for counting. In this system, you count like this: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. The # tells the computer that the following sequence is a series of hexadecimal numbersin this case, three pairs of them.) The best way to learn a color's hex value is to choose the color you want by clicking on it in the palette and then looking at the code that Dreamweaver writes into the text box next to it.

    You can choose a different set of rainbow colors (the ones that appear in the palette), too, using the Palette Options menu. You can choose from among five different palettes: Color Cubes, Continuous Tone, Windows OS, Mac OS, and Grayscale. The first two contain the Web-safe color palette (colors that most browsers on most machines will reliably display in the same shades you pick) in different arrangements. The Windows OS and Mac OS palettes display the colors available on those respective operating systems when in 256 color mode. Finally, the Grayscale palette offers 256 somber shades of gray; you'll find them useful primarily when building Ingmar Bergman tribute sites.

    Finally, when you use the eyedropper to sample a color, Dreamweaver uses the nearest Web-safe colorone of only 216 colors. When people surfed the Web with old monitors and old video cards, sticking to Web-safe colors was a good idea. Today, however, most computer screens can show thousands or millions of different colorsmany more than are available from the Web-safe palette. In short, consider turning off this behavior by turning off the Snap to Web Safe option in the Palette Options menu. You'll have a much wider range of colors to choose fromand all of them, these days, are safe.


    While it may seem a bit like overkill to have four different colors for links, the regular and visited link colors can provide very useful feedback to Web visitors by indicating which links they've already followed and which remain to be checked out. For its part, the rollover link gives instant feedback, changing color as soon as a visitor moves the mouse over it. Since an active link color appears for only the split second someone actually clicks the link, if you never set its color, nobody will notice.

  14. Click OK to close the window and apply these changes to the page .

    You return to your document window. If you see an asterisk next to the file name at the top of the document window, Dreamweaver is trying to tell you that you've made changes to the page since you last saved it (see Figure 1-16).

    Figure 1-16. The title of the page appears in the Toolbar and at either the top of the screen (Windows, top) or at the top of the document window (Mac, bottom).
  15. Choose File Save (or press Ctrl+S [ -S]) .

    Save your work frequently. (This isn't a Web technique as much as a computer-always-crashes-when-you-least-expect-it technique.)

1.3.4. Phase 4: Adding Images and Text

Now you'll add the real meat of your Web page: words and pictures.

  1. On the Common tab of the Insert bar, select Image from the Image menu (see Figure 1-17) .

    Alternatively, choose Insert Image. Either way, the Select Image Source dialog box opens.

    Figure 1-17. Some of the buttons on Dreamweaver 8's Insert bar do double duty as menus (the buttons with the small, black, down-pointing arrows). Once you select an option from the menu (in this case, the Image object), it becomes the button's current setting. If you want to insert the same object again (in this case, an image), you don't need to use the menujust click the button.
  2. Browse to the images folder in the DWTutorial1 folder; double-click the graphics file called banner.gif .

    The Image Tag Accessibility window appears. Fresh out of the box and onto your computer, Dreamweaver 8 has several accessibility preferences automatically turned on. These preferences are aimed at making your Web pages more accessible to people who use alternative devices for viewing Web sitesfor example, people with viewing disabilities who require special Web browser software such as a "screen reader," which literally reads the contents of a Web page out loud. Of course, images aren't words, so they can't be spoken. But you can add what's called an alt property. This is a text description of the graphic that's useful not only for screen-reading software, but also for people who deliberately turn off pictures in their Web browsers, in exchange for a dramatic speedup in the appearance of Web pages.


    Note: If you don't see this window, type Ctrl+U ( -U) to open the Preferences panel, select the Accessibility category, and then turn on the Images checkbox and click OK.
  3. In the Alternate Text box, type The National Exasperator . Click OK to add the image to the page .

    The banner picture appears at the top of the page, as shown in Figure 1-18. A thin border appears around the image, indicating that it's selected. The Property inspector changes to reflect the properties of the image.


    Note: You can also add or edit the alt text in the Property inspector (Figure 1-18).
    Figure 1-18. When you select an image in the document window, the Property inspector reveals its dimensions. In the top-left corner, a small thumbnail image appears, as does the word Image (to let you know an image is selected) and the image's file size (in this case, 8 KB). The other image properties are described in Chapter 5.
  4. Deselect the image by clicking anywhere in the document window, or by pressing the right arrow key .

    Keep the arrow keys in mindthey're a great way to deselect a selected page element and move your cursor into place for adding text or more images.

  5. Press Enter to create a new paragraph. Type Ad Sizes and Rates .

    Notice that the text is white and uses the Verdana font; these are the exact properties you set up earlier in the Page Properties window. The Property inspector now displays text-formatting options.


    Note: The key called Enter on a Windows keyboard is named Return on most Macintosh keyboards. On the Mac, you can press either Return or Enter.
  6. From the Format menu in the Property inspector, choose Heading 1 (see Figure 1-19) .

    The text you just typed becomes big and boldthe default style for Heading 1. This Format pop-up menu offers a number of different paragraph types. Because the text isn't visually bold enough, you'll change its color next.

    Figure 1-19. When you're editing text, the Property inspector offers the relevant formatting controls. You'll notice that both the font and color are already set with the font properties you chose in the Page Properties window (steps 9, 10, and 11 on Section 1.3.3).
  7. Select the text you just typed .

    You can do so either by dragging carefully across the entire line or by triple-clicking anywhere inside the line. (Unlike the Format menu, which affects an entire paragraph at a time, most options in the Property inspector, like the one you'll use next, apply only to selected text.)

  8. Click the color box in the Property inspector and select a black color swatch .

    Two things happen. First, the color of the text changes to black (it'll actually appear white until you deselect it). Second, a new style name appears in the Style menu on the Property inspector, named Style1 (or Style2, or Style3, depending on whether your independent spirit has led you off into earlier formatting expeditions). Make a note of the name; you'll need it later in this tutorial.

    Meanwhile, Dreamweaver has actually created a new CSS style and applied it to this heading. The Style menu lets you apply any styles you (or Dreamweaver) create. You'll learn plenty about CSS styles in Chapter 6.

  9. Click to the right of the heading text to deselect it. Press Enter to create another new paragraph. Type this: The National Exasperator offers three sizes and rates for advertisements .

    This text is smaller than the headline above it. When you press Enter or Return at the end of a headline-formatted paragraph, Dreamweaver automatically formats the next line as a paragraph. (Want proof? Look at the Property inspector's Format menu. It says "paragraph.")

    Not only is this new text a bit dull, it also retains the black color of the headline. If you look at the Style menu in the Property inspector, you'll notice that this text is also in Style1, so your next move is to remove this formatting.

  10. From the Property inspector's Style menu, choose None .

    You've just removed the style. Now you'll spice up the text, like this:

  11. Highlight the entire sentence you've most recently typed. From the Font menu in the Property inspector, choose "Georgia, Times New Roman, Times, serif."

    The sentence is now displayed in another font. (Why is more than one font listed for each choice in the Font menu? Turn to Section 3.3.2 to find out.) In addition, Dreamweaver has created another CSS style (called Style2, or whatever) and listed it in the Style menu on the Property inspector. Again, keep track of the name of this style; you'll need it later in the tutorial.

    Next, you'll want to italicize the name of your publication.

  12. Select the words "National Exasperator," and then click the button labeled I in the top row of the Property inspector .

    The I button, of course, means italics . Dreamweaver italicizes your selection.


    Note: Dreamweaver actually uses the <em> tag (meaning emphasis ) whenever you apply italics to text. See Section 3.3.2 for full details.

    For added attractiveness, you can now add a horizontal linea rule , as designers call itunderneath the text you've typed so far.

  13. Click at the end of the last sentence to place the cursor there, and press Enter to create a new paragraph. From the Insert bar menu, choose HTML .

    A new set of Object buttons appears on the Insert bar. You'll insert the first object: the horizontal rule.

  14. Click the Horizontal Rule button (the first button on the Insert bar) .

    You can also choose Insert HTML Horizontal Rule. Either way, Dreamweaver inserts a line across the page. Its highlighted, meaning that the Property inspector is showing its characteristics.

  15. With the horizontal rule still selected, type 700 in the W field of the Property inspector. Press Enter .

    The width of a freshly minted horizontal line is 100 percentmeaning that it spans the entire width of a browser window, no matter how wide the window is. You've just changed your selected line's width to 700 pixels.

  16. From the Align menu in the Property inspector, choose Left .

    Normally, a horizontal rule is centered in the middle of a page. Now the line is aligned to the left, to match the alignment of the text and graphics on the page.

    Next, you'll add a subhead, a graphic, and a set of bulleted information points to the page.

  17. Click below the horizontal rule and type Square Button . From the Style menu in the Property inspector, choose None; from the Format menu, choose Heading 2 .

    You've removed the style that was applied to the previous paragraph, and the text for Square Button (one of the online ad sizes your Web site will be offering) changes. It's now bigger and bolder, though smaller than the Heading 1 paragraph at the top of the page. Now apply some additional formatting to this text.

  18. Select the text you just typed, and then click the Color box in the Property inspector. From the pop-up palette, choose a light-yellow color .

    The text changes to the color you selected. Dreamweaver adds yet another style (Style3) to the Style menu. This is the last time you need to do this, but note the name Dreamweaver uses for this style; you'll need it later on, when you rename the style to something more descriptive.

    A quick way to select this paragraph is to click the <h2> that appears in the lower-left corner of the document window. (This is the tag selector, which lets you quickly and accurately select HTML tagsin this case, the Heading 2 tag.)

  19. Click at the end of the line of text; press Enter .

    Although the new line is formatted as a "paragraph" and not Heading 2, it still retains the style of the previous paragraph. You don't want that style for this paragraph, so you need to get rid of it.

  20. From the Style menu in the Property inspector, choose None (see Figure 1-20) .

    Doing so removes the style from the text, restoring your original page setting's white Verdana text.

    Now you'll add another imagea sample advertisementto the page.

    Figure 1-20. The Property inspector's Style menu lists CSS styles, like those created by Dreamweaver in this tutorial or those you'll learn to create in Chapter 3. You can use this menu to apply styles to selected text.
  21. On the Common tab of the Insert bar, click the Image button .

    Alternatively, choose Insert Image.

  22. Type Square Ad Sample in the Alternative Text box and then click OK .

    A square ad for the National Exasperator appears.

    Next, you'll add a bulleted list of specifications for this type of ad.

  23. Click to the right of the image to deselect it. Press the Enter key to create a new paragraph .

    A new paragraph appears just below the graphic. Next, you'll transform it into a bulleted list.

  24. Click the Bulleted List button in the Property inspector (see Figure 1-21) .

    Next, you'll be adding a series of bulleted items that explain the size and cost of a "Square Button" ad in the National Exasperator .

    Figure 1-21. Many of the Property inspector text formatting options are similar to tools you'd find in a word processing program: B for bold, I for italics, text-alignment options, bulleted and numbered lists, and so on.
  25. Type $100 for one month ; hit Enter. Type Dimensions 125 pixels x 125 pixels and hit Enter twice .

    When working in a list, pressing Enter once creates a new list item, but pressing Enter two times ends the list and leaves you with a paragraph. (You can also turn a bulleted item into a regular paragraph by pressing the Bulleted List button again or by clicking the Outdent button.)

    You've just added a list with two bulleted items and reset the formatting to a regular paragraphno indent and no fancy formatting. Next, you'll add another horizontal rule.

  26. Choose Insert HTML Horizontal Rule .

    Alternatively, on the HTML tab of the Insert bar, click the Horizontal Rule button. (For even faster horizontal ruling next time, add this button to the Favorites tab, as described on Section 4.4.2.)

    Dreamweaver inserts a line across the page. This line is highlighted, meaning that it's selected.

  27. Click in the W field of the Property inspector; type 700 . From the Align menu in the Property inspector, choose Left .

    As you did once before, you just created a horizontal rule of a specified width, aligned against the left edge of the window.

    Your Web page in progress should now look like the one shown in Figure 1-22.

  28. Choose File Save .

Figure 1-22. The Web page is starting to come together. You've added graphics, text, and horizontal rules, as well as played with some of the text-formatting options available in the Property inspector.

1.3.5. Phase 5: Preview Your Work

Dreamweaver is as close as a Web design program can be to a WYSIWYG application, meaning that for the most part, What You See (in the document window) Is What You'll Get (on the Web).

At least that's how it's supposed to work. But Dreamweaver may display more information than you'll see on the Web (including "invisible" objects, table borders, and other elements that you won't see in a Web browser) and may display less (it sometimes has trouble rendering complex designs).

Furthermore, much to the eternal woe of Web designers, different Web browsers display pages differently. Pages viewed in Internet Explorer don't always look the same in more modern browsers like Firefox or Safari. In some cases, the differences may be subtle (for example, text may be slightly larger or smaller). Or they can be dramaticsome of the advanced page-layout techniques described in Chapter 8 look awful in older Web browsers. Throughout this book, you'll find tips and techniques to deal with this problem.


Tip: One entrepreneurial company has tackled this problem head-on. Using the services offered by Browsercam (www. browsercam .com), you can preview a page through many different browsers and operating systems, letting you test your design without having to set up lots of different computer and browser combinations yourself. Alas, entrepreneurs like to make money, so this service isn't free.

If you're designing Web pages for use on a company intranet and only have to worry about the one Web browser your IT department has put on everyone's computer, you're lucky. But most of us have to deal with the fact that our sites must withstand scrutiny by a wide range of browsers, so it's a good idea to preview your Web pages using whatever browsers you expect visitors to your Web sites to use. Fortunately, Dreamweaver lets you preview a Web page using any browser you have installed on your computer.

Before you can preview a page, you need to set up your list of browsers in the program's preference window, like this:

  1. Choose File Preview in Browser Edit Browser List .

    The Preview in Browser preferences window opens (see Figure 1-23).

    Figure 1-23. Dreamweaver can launch a Web browser and load a page in it, so you can preview your design. One useful option"Preview using temporary file"comes in handy when working with Cascading Style Sheets, as described on Section 6.4.2.
  2. Click the + button .

    The Add Browser or Select Browser window opens.

  3. Click the Browse button. Search your hard drive to find the browser program you use most frequently and select it .

    Dreamweaver inserts the browser's default name in the Name field of the Add Browser window. If you wish to change its name for display purposes within Dreamweaver, select it and type a new name. (But don't do this before selecting the browser, since Dreamweaver will erase anything you've typed as soon as you do finally select a browser.)

  4. Turn on the Primary Browser box. Click OK .

    You've just designated the browser as your primary browser while working in Dreamweaver. You can now preview your pages in this browser with a simple keyboard shortcut: F12 (Option-F12 on Mac).

    If you like, you can also choose a secondary browser, which you'll be able to launch by pressing the Ctrl+F12 ( -F12) key combination.

    Now you're ready to preview your document in a real, bona fide Web browser. Fortunately, Dreamweaver makes it easy.

  5. Press the F12 key (Option F12 on Mac) (or choose Edit "Preview in Browser and select a browser from the menu) .

    The F12 key (Option-F12 on Mac) is the most important keyboard shortcut you'll learn. Macintosh fans: Macromedia has changed the shortcut to Option-F12 in Dreamweaver 8 (so it doesn't interfere with the keyboard shortcut for Dashboard in OS 10.4). It opens your Web page in your primary browser, letting you preview your work.

    If you're using a Macintosh laptop, you may have to press Option-F12 and the function (fn) key in the lower-left corner of the keyboard.


    Note: The Document toolbar also has a Preview buttonthe globe icon. Click it to open a menu listing all the browsers you've set up in the "Preview in Browser" dialog box (Figure 1-23).
  6. When you're done previewing the page, go back to Dreamweaver .

    Do so using your favorite way to switch programs on your computerby using the Windows taskbar, or the Dock in Mac OS X.

1.3.6. Phase 6: Finishing the Page

You've covered most of the steps you'll need to finish this Web page. All you need to do now is add the rest of the ad sizes and rates, add some contact information, and add a copyright notice. But before that, you'll change the names of the styles Dreamweaver created. As you've seen, when you use the Property inspector to format the color and font of a text, Dreamweaver creates new CSS styles with goofy names like style1 and style2 . Sure, they're straightforward, but they're not very descriptive. Fortunately, Dreamweaver makes it easy to change the name of a style.

  1. In the Property inspector's Style menu, select Rename(see Figure 1-20) .

    This opens the Rename Style dialog box, which lets you select a style from a menu and then rename it by typing a new name.

  2. Make sure style1 (or whatever style was created in step 8 on Section 1.3.4) is selected in the Rename Style menu, type title in the New Name box, and click OK .

    Behind the scenes, Dreamweaver does a quick find-and-replace operation; essentially locating every instance of the old style name and replacing it with the new name you just provided. You'll notice that a new panelthe Results panelpops up at the bottom of the screen. You'll learn more about this on Section 18.3, but for now, just realize it's displaying the results of the behind-the-scenes search Dreamweaver just performed.

  3. Repeat steps 1 and 2 for the style created in step 11 on Section 1.3.4 (probably style2 ). Rename this style text .

    Using descriptive names for your styles will make them that much easier to identify when you need to edit them.

  4. Repeat steps 1 and 2 to rename the last style (created in step 18 on Section 1.3.4) adName .

    As you'll learn on Section 6.2, style names can't have spaces, so ad Name wouldn't work. Now, you'll finish up the page, by adding the remaining text and graphics.

  5. Click below the last horizontal rule in the document window; type Full Banner .

    Notice that there's no formatting. Since the text is a heading of the same importance as the "Square Button" paragraph heading above it, it would be nice to make it look the same.


    Note: If a horizontal rule is the last item on a page, sometimes you'll select the horizontal rule when you click at the bottom of the page. To get a new paragraph after the rule, just press the right arrow key (this deselects the horizontal rule) and press Enter.
  6. Select Heading 2 from the Format menu on the Property inspector, and select "adName" from the Style menu .

    This formats the text as a Heading 2, and also applies the style you just renamed .

    Now it's time to add another graphica sample full banner adand a set of bulleted information points, just as you did for the "Square Button" section of the page.

  7. Click at the end of the paragraph and press Enter to create a new paragraph; choose None from the Property inspector's Style menu .

    Doing so removes the style you applied a moment ago, creating a clean slate for adding and formatting new text or images.

  8. On the Common tab of the Insert bar, click the Image button (or choose Insert Image) .

    The Insert Image dialog box appears.

  9. In the DWTutorial1 images folder, double-click the file full_banner_ad.gif .

    The Image Tag Accessibility window appears (see step 2 on Section 1.3.4).

  10. Type Full Banner Ad Sample in the Alternative Text box and click OK .

    A full banner ad for the National Exasperator appears. Now you need only to add details for this ad.

  11. Click to the right of this image and hit Enter to create a new paragraph; click the Bulleted List button in the Property inspector .

    You've just added a bullet at the beginning of the paragraph.

  12. Type $560 for one month , and then press Enter; type Dimensions: 468 pixels x 60 pixels , and then press Enter twice to end the list .

    You've just created two bulleted items. To wrap up, you'll insert another horizontal line beneath your ad rates.

  13. Choose Insert HTML Horizontal Rule .

    Dreamweaver inserts the line; you'll need to make it look like the other lines on the page.

  14. With the horizontal rule still selected, click in the W field of the Property inspector and type 700 . From the Align menu in the Property inspector, choose Left .

    The line moves to the left edge of the window, just like the other lines you inserted.

  15. Choose File Save .

    You're now ready to add the last elements to this page and finish this tutorial.

  16. Click below the last horizontal rule in the document window; type Half Banner .

  17. Repeat steps 2 through 12 to add and format the final ad size and rates .

    You'll use the graphic called half_banner_ad.gif located in the images folder. Use the text "Half Banner Ad Sample" for the alt property. The two bulleted items of text should read: "$230 for one month" and "Dimensions: 234 pixels x 60 pixels."

  18. Press Enter twice to end the list and create a new paragraph .

    Next you'll add another horizontal rule by copying and pasting one you added earlier.

  19. Click any of the horizontal rules on the page and choose Edit Copy .

    As with most other programs, you can select anything in the document window, copy it, and then paste it.

  20. Click in the empty paragraph at the bottom of the page and choose Edit Paste .

    The keyboard shortcut Ctrl+V ( -V) is a faster way to paste.

  21. Click to the right of the new rule, and hit Enter .

    You'll next add some links to the page: an email link for sending email and an external link to another Web site.

  22. Type Contact Information . Choose Heading 1 from the Format menu in the Property inspector, and select "title" from the Style menu .

    You've just created a big, bold heading just like the one at the top of the Web page.

  23. Click to the right of the Heading 1 to deselect it and press the Enter key; choose "None" from the Style menu in the Property inspector .

  24. Type The sales staff at the National Exasperator would be happy to take your money. Contact us and we'll make it so. Call us at 555-768-9090 or email our (don't type a final period) .

    Web pages can contain email links: a link that opens your visitor's email program and automatically adds an email address to a new message. Dreamweaver has a built-in function for adding this type of link.

  25. Click the Insert Email Link button in the Insert bar (see Figure 1-17), or choose Insert Email Link .

    The Insert Email Link dialog box opens.

  26. Type Advertising Department in the Text field .

    This is the text that will appear on the Web page.

  27. Type adsales@nationalexasperator.com in the E-Mail field, and then click OK .

    Notice that "Advertising Department" appears on the page underlined and in yellow. This is the formatting for links that you specified earlier in the Page Properties window. The email address adsales@nationalexasperator.com, however, is embedded into the link of the page. It may be invisible to your audience, but a Web browser knows it's there.

  28. Click at the end of the line and type a period. Press Enter to create a new paragraph .

    A blank line appears. You'll add some text and a link to another Web site.

  29. Type For more information on online advertising, visit the Interactive Advertising Bureau .

  30. Select the words "Interactive Advertising Bureau."

    You'll turn these words into a link that, when clicked, will send your visitor to another Web site.

  31. In the Link field in the Property inspector, type http://www.iab.net/ and press the Enter key .

    You've just added an external link . When you preview this page and click that link, you'll be taken to the home page for the Interactive Advertising Bureau.

  32. Click at the end of the line; press Enter and add another 700-pixel horizontal rule to the page .

    Either insert a new rule as in steps 13 and 14 earlier, or use the copy-and-paste technique in steps 19 and 20. This line, like the other ones you've added, helps break up the page into distinct sections.

  33. Click below that last line and type Copyright 2006, the National Exasperator .

    No page is complete without stamping your legal rights onto it. But that doesn't mean you have to rub it in anyone's face, so you'll make the text a little less noticeable, as follows .

  34. Select your copyright notice text; from the Size menu in the Property inspector, choose 12 .

    You've just set the text to 12 pixels tall. (See Section 6.7 for an explanation of different ways to specify the size of text.) It also creates one last style: Style4. You can choose to rename this (following steps 1 and 2, earlier) to something more meaningful like "copyright." Lastly, you'll add some text and link it to a page already in your site.

  35. Click at the end of the copyright notice and type View our online privacy policy .

    Now for the link.

  36. Select the text you just typed. In the Property inspector, click the folder icon that appears to the right of the link field .

    The Select File dialog box appears.

  37. Navigate to the DWTutorial1 folder and select the file called privacy.html .

    To apply the link, select the file and click OK, or simply double-click the file name. Either way, the Select File box closes, and you return to your finished Web page.

  38. Choose File Save. Press the F12 key to preview your work in your browser .

    Test out the links to make sure they work.

Congratulations! You've just built your first Web page in Dreamweaver, complete with graphics, formatted text, and links. If you'd like to compare your work with an actual, Internet-posted version of the same page, visit the tutorial page for this book, www.sawmac.com/dw8/tutorials. (The finished page, called finished.html , is also in your DWTutorial1 folder.)

Much of the work of building Web sites will involve using the procedures covered in this tutorialdefining a site, adding links, formatting text, and inserting graphics. The next few chapters cover these basics in greater depth and introduce other important tools, tips, and techniques for using Dreamweaver to build great Web pages.



Dreamweaver 8[c] The Missing Manual
Dreamweaver 8[c] The Missing Manual
ISBN: 596100566
EAN: N/A
Year: 2006
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net