HTML and CSS Reference
The base element is useful when a single document is moved to a new folder. Rather
than rewriting all of the relative paths to refl ect the document's new location, the base
element redirects browsers to the document's old location, allowing any relative paths to
be resolved as they were before.
Problem Solving: Managing Your Web Site
Web sites can quickly grow from a couple of pages to dozens or hundreds of pages. As the
size of a site increases, it becomes more difficult to get a clear picture of the site's structure
and content. Imagine deleting or moving a file in a Web site that contains dozens of folders
and hundreds of files. Could you easily project the effect of this change? Would all of your
hypertext links still work after you moved or deleted the file?
To effectively manage a Web site, you should follow a few important rules. The first is
to be consistent in how you structure the site. If you decide to collect all image files in one
folder, you should continue that practice as you add more pages and images. Web sites are
more likely to break down if files and folders are scattered throughout the server without a
consistent rule or pattern. Decide on a structure early and stick with it.
The second rule is to create a folder structure that matches the structure of the Web site
itself. If the pages can be easily categorized into different groups, those groupings should
also be reflected in the groupings of the subfolders. The names you assign to your files and
folders should also reflect their uses on the Web site. This makes it easier for you to predict
how modifying a file or folder might impact other pages on the site.
Finally, you should document your work by adding comments to each new Web page.
Comments are useful not only for colleagues who may be working on the site, but also for
the author who must revisit those files months or even years after creating them. The com-
ments should include:
• The page's filename and location
• The page's author and the date the page was initially created
• A list of any supporting files used in the document, such as image and audio files
• A list of the files that link to the page, and their locations
• A list of the files that the page links to, and their locations
By following these rules, you can reduce a lot of the headaches associated with maintain-
ing a large and complicated Web site.
Linking to Locations within a Document
Gerry has studied the navigation lists you created and would like you to add another
navigation list to the Glossary page. Recall that the Glossary page contains a list of digital
photography terms. The page is very long, requiring users to scroll through the document
to fi nd a term of interest. Gerry would like you to create a navigation list containing the
letters A through Z. From this list, Gerry wants to give users the ability to jump to a spe-
cifi c section in the glossary matching the clicked letter.
See Figure 2-17.