Using Graphics on Your Dreamweaver Pages Once you have some graphics and have saved them in the appropriate formathere, JPEG or GIFactually getting them onto your page is fairly easy. What you may find difficult is getting your images positioned where you want them. Thankfully, Dreamweaver has a few tricks up its sleeve to help you, as you'll soon see. But let's start with something easy: setting a graphic for your page's background.
Using a Graphic as a Page Background Many sites on the web use either a colored or graphical background on their pages. This makes the site look a little more interesting, and also plays a part in a site's overall design and brandingKeep a high contrast between your background and your page text, to keep your page legible.In designing your page's background, keep a few things in mind. If you're going to use a color, don't choose anything too bright. You don't want your visitor's head to explode, so choose a color that's easy on the eyes. If you decide to use a graphical background, be very cautious. Background graphics can easily render a page's text illegiblea major frustration for web surfers. Keep a high contrast between your background and your page text, and you shouldn't have a problem.:This page uses a subtle background graphic: a brushed metal look. Even though the page may look like it has one massive image in the background, effects like this can usually be created with a single, tiny graphic.[View full size image] Here's the sort of background image to avoid. Here's how to set your page's background:
1. | Choose Modify > Page Properties.The Page Properties dialog box appears.[View full size image] | 2. | In the Appearance category at the left side of the dialog box set your page's background by doing one of the following:To change your page's background color, click the color swatch next to Background Color. Dreamweaver's 216 web-safe color palette opens. You can select a color from this or any other color palette. To set a background image, click the Browse button next to the Background Image field and navigate to the image that you want to use. | 3. | Click OK.The background of your page changes to reflect your settings. If you chose to use a background image, the image appears behind your page's content and tiles horizontally and vertically. Because of this tiling behavior, many designers choose a patterned background image with no discernable edgessorta like the patterned tiles on your kitchen floor. Notice too that the CSS Styles panel (if it's set to All mode) displays a new style: body. Options set for the background are actually controlled by CSS. For more on using CSS to control your page's background, see "Controlling Your Page Background with CSS." | 4. | If you want to modify the background, do one of the following:To choose a different background for your page, choose Modify > Page Properties to return to the Page Properties dialog box, where you can change your settings.To fine-tune the background and the way it works with your web pages, open the CSS Styles panel and follow the steps in "Controlling Your Page Background with CSS." |
Controlling Your Page Background with CSS Now that you have a background on your page, you may wish to make further modifications. The background for your page is always controlled by HTML's <body> tag. So when you set a background through the Page Properties dialog box, Dreamweaver creates a redefine88 tag for you. By making changes to the rules that govern the <body> tag in CSS, you can control how the image tiles, whether the background image scrolls with the page, and a few other neat options not available in the Page Properties dialog box.To change your page background via CSS, follow these steps:
1. | Open the CSS Styles panel (Window > CSS Styles) and set the panel's mode to All. | 2. | In the All Rules pane at the top of the panel, double-click the body style. | 3. | In the CSS Rule Definition dialog box, select the Background category.The Background settings control graphics and color that appear behind objects on your page. | 4. | To change the color or image being used in the background, do one of the following:Click the Background Color swatch and choose a new color.Click the Browse button beside the Background Image field and navigate to the new background image. | 5. | If you're using a background image, you can make some additional adjustments:To control the tiling behavior of your background image, choose an option from the Repeat pull-down menu.Repeat tiles the graphic as it normally does (both horizontally and vertically), Repeat-X tiles the graphic only horizontally, and Repeat-Y tiles the graphic only vertically. No Repeat disables the tiling behavior of your background graphic. To specify whether the background image scrolls with your page contents or remains fixed when the visitor scrolls down your page, choose an option from the Attachment menu. Note, though, that the user's browser ultimately controls how the page scrolls.To control the horizontal and vertical placement of your background image, choose options for Horizontal Position and Vertical Position.You can place your image at the left, right, top, or bottom of the page, and center it vertically and horizontally. You can also enter a specific value, in pixels, to move the background image.[View full size image] | 6. | When you're done modifying your background, click OK.Your changes are applied to the background of your page. |
Now let's start thinking a little grander here. In Chapter 8, you saw how to work with external style sheets. Wouldn't it be great if you could control the background of all the pages in your site from a single style? Well, you can! In your external style sheet, create a new rule for the <body> tag; then set the appropriate options in the Background category, just as we did here. Once that's done, link all your pages to the external style sheet, and you're ready to go.Also, you can specify a background for just a single style rather than for the entire page. For example, you can set a yellow background behind all of the Heading 1 elements on your page. If you've already set a background color for your page, both the style's background and the page background will appear. If you have some CSS styles kicking around from Chapter 8, try setting options in their Background category. This will result in a background appearing behind only the space that the style occupies on the page. CSS's parlor tricks are endless!
Placing Images on Your Page Now you're ready to insert images on your page. Before you begin, make sure that all the graphics that you want to use have been copied to your site folder; otherwise, you'll have serious problems when you go to upload your pages to your remote site. We'll talk about possible problems that may arise in a bit, but first, let's get droppin' graphics onto your page.Before placing images on your page, make sure that all your graphics have been copied to your site folder.Here's how to insert an image on your page:
1. | Click where you want to insert an image.Chapter 4 for details). |
|