Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

The Old Background Banner Trick

One of the most prominent tricks employed in Figure 13.3 is the use of a 1,000-pixel-high background image (named wainscot.gif). Because the entire page is unlikely to be more than 1,000 pixels high, the background only appears to repeat in the horizontal direction. Since the bottom part of the image is all the same color, it looks like the background is only a banner at the top of the page.

Unlike a foreground image used as a banner, however, this wainscoting will automatically size itself to go from "wall to wall" of any sized window. It takes up less space on a disk and transfers over the Internet faster because only one repetition of the pattern needs to be stored.

If you use this trick to make background banners on your own Web pages, you should make them at least 2,000 pixels high. The page shown in Figure 13.3 can actually become longer than 1,000 pixels when someone uses a very large font size, in which case the wainscoting shows up again at the very bottom or middle of the page.

By using a very wide background that repeats vertically, you can easily make a repeating banner that runs down the left side of a page, too. If you don't want text to obscure the banner, put a very large, totally transparent image at the beginning of the HTML page with <img align="left" />.

Figures 13.4 through 13.6 show the HTML and graphics that implement a left-side banner, as well as the resulting Web page.

Note that I right-justified the other graphics, both for aesthetic reasons and so that I could avoid using <br clear="left" />, which would skip all the way to the bottom of the left-justified banner graphic.

13fig04.gif

Figure 13.4 With a few strategic changes, you could put the top banner in Figure 13.3 to the left side.

Share ThisShare This

Informit Network