Chapter 6: Putting the Web in World Wide Web: Adding Pointers and Links
109
You can change the default prefix for links on your page by using the <base href=”newbase-url” /> tag. For example, <base href=”http://alt-server.college.edu/joe/ ” /> causes all relative URLs to be resolved to the alt-server.college.edu server rather than the www.college.edu server. More interestingly, you can use the target attribute of the base tag to point links to other windows, a subject explored in greater depth in Chapter 8, when I discuss frames and frame-based designs. For now, experiment by adding the following line to your HTML page—this forces all links to open up in new windows—and watch how all the links change their behaviors: <base target=”_blank” />
Organizing a Web Site After you move beyond one or two Web pages and a half-dozen graphics, it quickly becomes clear that good organization makes site maintenance and management easier. To this end, a hierarchical directory approach can prove to be a big advantage. Imagine you are building a Web site for a local delicatessen. In addition to the home page, you also want to have a variety of information available online about the sandwiches and soups the deli offers. Planning for future growth, you might opt to organize the information as shown in Figure 6-3.
Dave's Deli
soups index.html
corn-chowder.html tomato.html
sandwiches order-counter.html
lentil.html
mystery.html
turkey.html
ham.html
veggie.html
Figure 6-3: Organizing the Web page flow for the deli menu data.
When you want to translate the illustration in Figure 6-3 into an HTML layout that works with the subdirectories, you might create a first draft of the home page that looks like this: