Home > Articles

Building a Web Page

This chapter is from the book

This chapter is from the book

Working with Images

One of the more convoluted topics as it relates to the web is that of images. As you are with font faces, colors, and sizes, you’re limited in the types of images you can use. Even worse, because you’re dealing with the web, bandwidth becomes an issue. For this reason, images must usually remain small resulting in degradation of quality and loss of color variation. While print publishers have a wide array of image choices including EPS, TIF, JPEG, BMP, PCX, PICT, and PNG and are not limited by size, web developers are limited to working with GIF, JPEG, and PNG and even worse must use tools to optimize the images before they’re ready for use in websites. Knowing what types of images to use can also become a factor when designing for the web. As a good rule of thumb, GIF, JPG, and PNG files should be used as follows:

  • GIF: GIF, which stands for Graphical Interchange Format is used for images or graphics with smaller amounts of color and graphics without much tonal range. Because GIFs read color in a horizontal line, the more color it encounters when reading, the larger the file size. Also, because GIFs read color in a horizontal line, too much color gradation can result in banding; the process of gradients being broken up into bands representing a lower dimension of color variation. GIFs also have a color table attached to them which dictates to the graphic how many colors and which color can be used in the artwork. More colors in the color table yield higher file sizes. GIFs can also store transparencies and animations but are ideal when used for flat, lower-colored graphics.

  • JPEG: JPEG, which stands for Joint Photographic Experts Group, is a lossy compression standard used on graphics with high tonal ranges such as photographs. This compression standard removes pixels from an image to reduce the file size. Too much compression can result in artifacts which causes the image to look blurry and unclear. As a good rule of thumb, use the JPEG file format when adding pictures to your websites that contain a lot of gradation such as family photos.

  • PNG: PNG, which stands for Portable Network Graphics, was introduced as a relacement to GIF a few years ago. Although Macromedia has certainly adopted the file format as standard within its Fireworks program, for the web, PNG holds a few advantages over GIF. First, color features are greater in that PNG supports alpha transparencies, which means you can have 256 levels of transparency instead of just on and off as is true for the GIF format, cross-platform control of image brightness, and two-dimensional interlacing (a method of progressive display that is similar to JPG). In addition, PNG compresses 5%–25% percent better than GIF, making this an attractive format for web developers. Of course the downside to using PNG on the web is that browser support—or more specifically down-level browser support—for PNG is simply not up to par. Even the newer versions of Internet Explorer for Windows don’t support the transparency features in PNG.

As a rule of thumb, if you’re working with flat, solid images, use GIF. If however, you’re working with images with a lot of color gradation like photographs, use JPEG. For more information on links to resources on image formats, please reference Appendix C, "General Resources."

Inserting Images into a Dreamweaver Document

The traditional Dreamweaver method of inserting an image is to use the browse-to-file method in which you select Insert, Image, browse to your file, and click Open to insert the image in the page. However, Dreamweaver also features a unique drag-and-drop method of inserting images directly from the File list. Before we jump ahead of ourselves, however, let’s review the process of inserting an image by browsing to the image file using the Select Image Source dialog. To use this method, follow these steps:

  1. Start by placing your cursor at the top of the page (or where ever you want the image to appear).

  2. Choose the Image option from the Insert menu or select the Image icon from the Images submenu of the Common category in the Insert bar. Either method opens the Select Image Source dialog.

  3. Browse for the file header.gif located in the Images folder of the defined Dorknozzle site. As you can see in Figure 3.32, the filename, an image preview, and dimensions in terms of size and download time based on file size are displayed in the dialog.

  4. Figure 3.32

    Figure 3.32 Browse to header.gif so that you can see the filename and the image preview.

  5. Aside from simple browsing and previewing, the Select Image Source dialog also includes the ability to browse by file type, to enable and disable image previewing, and to set the file path method (document or site root relative) for the file. For our example, simply click OK. The image is inserted at the top of the page and blends in nicely with our background image.

You might have to remove extra line breaks between the image and the date stamp (place your cursor just before the date stamp and press Backspace on your keyboard) to get your design to look like Figure 3.33.

Figure 3.33

Figure 3.33 The inserted header image blends in nicely with our background image.

A second option for inserting images is the drag-and-drop-from-the-File-list-panel method. By far the simplest method, you can add an image to your page by simply selecting the image from the Site Files panel and dragging it into the web page. Try this method on your own by removing the current headings (About Dorknozzle and Company Events) from the page and dragging the two subheader images (subheader_about.gif and subheader_companyevents.gif) onto the page to replace the headings. The result should resemble Figure 3.34.

Figure 3.34

Figure 3.34 Insert the two subheading images by dragging them from the File list panel onto the web page.

Formatting Images within a Document

Of course, like every other element that can be inserted into your web pages, images allow you to format numerous properties directly from the Properties Inspector. As an example, drag and drop a new image (intranetsymbolism.gif) from the File list directly into the The Company Intranet section of text so that it resembles Figure 3.35.

Immediately you’ll notice that the text doesn’t wrap nicely around the image. Setting the text alignment is just one of the many features you can do from the Properties Inspector. The callouts in Figure 3.36 highlight the complete feature set.

Figure 3.35

Figure 3.35 Drag the intranetsymbolism.gif image onto the page.

Figure 3.36

Figure 3.36 Dreamweaver’s image-based Properties Inspector includes numerous property modifications for an image.

A detailed list of each feature, moving from left to right and basic to advanced is outlined here:

  • Image Thumbnail: Shows a small thumbnail of the selected image.

  • Image Size: Displays the selected image’s size in kilobytes.

  • Image Name: Provides a method for uniquely identifying the selected image.

  • W and H: The width and height of the image are shown here. Dreamweaver allows you to stretch an image, in which case the values in these boxes will be bolded. Bolded values mean that the width and height of the stretched image do not correspond to the embedded values of the image. In fact, it is recommended that an image editor such as Fireworks be used to properly resize images.

  • Src: Short for source, this is the file path to the image on your computer. This value can also be an external web address, in which case the image shows broken but will display within the browser.

  • Link: Add a hyperlink to your image here. Hyperlinks are outlined with more detail later in this chapter.

  • Alt: For accessibility reasons, you’ll want to enter alternate text here. Entering alternate text is beneficial for a variety of reasons. First, it allows text-to-speech readers to present the alternate text to the disabled user since the reader can’t make out the image. Second, in Internet Explorer, a yellow tooltip appears with the alternate text when a user hovers over the image. Finally, on slower connections, the alternate text appears first while the image is loading. See Appendix A, "Accessibility," for more about alternate text.

  • Edit: Dreamweaver incorporates minimal editing functionality in this group of icons. For instance, you can open the selected image directly in Fireworks for editing or optimizing. You can also crop, sharpen, or change the brightness or contrast of the image directly in Dreamweaver. This integration is covered with more detail in Chapter 19, "Integrating with Fireworks." It’s important to point out that changing image properties through these options is permanent. I highly recommend that you have a backup of your image before using these features.

  • Class: Allows you to apply a CSS class to your image.

  • Image Map: Discussed with more detail later in this chapter, an imagemap is a method for creating multiple hyperlinked hotspots within a selected image.

  • V Space and H Space: Enter values here to create vertical and horizontal spacing in pixels around your image.

  • Target: When a value is added to the link text box, this menu becomes enabled. Targets, as you will see, provide a method for targeting browser windows when a user is linked from one web page to the next.

  • Low Src: Although you’re certainly free to generate high-quality images with large sizes (not recommended), always create a low-resolution image that you can reference here. This way, the browser loads the low-resolution image first, which the user can see as the browser finishes loading the high-resolution image.

  • Border: Use the border text box to add a border around your image in pixels. The color of the border depends on the default text color in the page and cannot be independently changed.

  • Align: Choose from these options to align the image left, center, or right on the page. Default is Left Align.

  • Text Align: Provides options for aligning the text around an image. Options include Baseline, Top, Middle, Bottom, Text Top, Absolute Middle, Absolute Bottom, Left, and Right. Default is Bottom.

Although we’ll end up using every property modification throughout the book, for now, format the properties of the image such that you’ve added the text Intranet Symbolism in the Alt text box and you’ve selected the Left option from the Align menu. The result resembles Figure 3.37.

Figure 3.37

Figure 3.37 Modify the name, alt text, and alignment of the image.

Image Placeholders

Image placeholders are a handy option to use while you’re developing the content of a web page and don’t necessarily have the finished images. Once you’ve inserted an image placeholder, you can easily adjust width and height dimensions to your liking. When you’re content with the dimensions, you can then select the Create option from the Properties Inspector to launch Fireworks and begin creating the image. To see how image placeholders work, follow these instructions:

  1. Place your cursor just before the The Company Intranet text and choose Insert, Image Objects, Image Placeholder.

  2. The Image Placeholder dialog appears, allowing you to give your place holder a name, a width, height, color, and for accessibility reasons, the option to insert alternate text. I’ll format my dialog similar to Figure 3.38.

  3. Figure 3.38

    Figure 3.38 Format the Image Placeholder dialog.

  4. After you click OK, the temporary image placeholder appears on the page as a solid color image similar to Figure 3.39.

Figure 3.39

Figure 3.39 The image placeholder appears on the page as a solid color image.

Notice that the image placeholder includes the name and dimensions of the image. Selecting the image placeholder reveals the image placeholder-based Properties Inspector, which appears similar to the image-based Properties Inspector except for the fact that you can freely modify the width, height, and color. The image placeholder-based Properties Inspector also features the Create button which, when clicked, opens Macromedia Fireworks (assuming that that program is installed) complete with a new document, sized according to the image placeholder dimensions. We’ll be discussing Dreamweaver and Fireworks integration with more detail in Chapter 19, "Integrating with Fireworks."

Rollover Images

Creating images that change appearance when a user’s cursor rolls over the image, otherwise known as rollover images, have traditionally been a tricky task for web developers. In the past, web developers begged, borrowed, and stole JavaScript code that they could "plug into" their websites to perform this operation. Fortunately for you, Dreamweaver includes an intuitive Insert Rollover Image dialog, available from the Image Objects submenu of the Insert menu.

To insert a rollover image within the page, follow these instructions:

  1. Place your cursor just above the horizontal rule on the page.

  2. Select Insert, Image Objects, Image Rollover. The Insert Rollover Image dialog appears.

  3. Format the Insert Rollover Image dialog similar to Figure 3.40.

  4. Figure 3.40

    Figure 3.40 Format the Insert Rollover Image dialog to reference our images.

  5. As you can see from Figure 3.40, the dialog allows you to insert an image name, two image states (typically these two images will have the same size and text but differ in color), alternate text, and a hyperlink. The dialog also allows you to check functionality that forces the browser to preload both images before the original is loaded. When you’ve formatted the properties, click OK.

The rollover image appears on the page. Now try viewing your page in the browser by choosing the Preview In Browser option from the Document bar or by pressing F12 (see Figure 3.41). In the browser, move your cursor over the new image. Notice that the original image (button_rollover1.gif) changes color to its rollover state (button_rollover2.gif).

Figure 3.41

Figure 3.41 The original image appears just above the horizontal rule.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020