There are a few ways you can start creating a Web document. You can begin with a template and modify it to meet your needs or download and modify the source code of an existing Web document off the Internet. Web browsers, such as Netscape Navigator and Mosaic, let you display a window containing the HTML codes and text used to create documents on the Web or save the HTML codes and text to a file. The problem with this method is that it is amazing how many Web documents break the basic rules of HTML. Just because you're viewing a home page for a large company is no guarantee that the page is created correctly. This chapter takes a different approach. It discusses the basic elements used to create a simple home page and presents valid elements and procedures you can follow to construct your own HTML documents. References are made throughout this chapter to other areas in this book where you can obtain more detailed information about each subject. To help you create correct Web pages we'll focus in this chapter on inserting elements and verifying your document using HoTMetaL PRO, which is included on the Companion CD-ROM. Adding Markup to HTML Documents As mentioned in Chapter 1, "The World Wide Web & Hypermedia Publishing," the elements that specify how to display text are collectively called markup. Markup is the use of codes that tell the Web browser how to display your words. The document is composed of text that takes its cues from the markup. Using markup is a lot like using parentheses in algebra or entering a formula into a spreadsheet. Instead of parentheses, HTML markup uses codes within angle brackets. Markup typically consists of a beginning code, commonly referred to as a tag, that specifies the effect, and an ending tag that includes a forward slash to identify the end of the markup. For example
Welcome to the Internet home page for A Clean Well-Lighted Place for Books -- a cathode-ray extension of our incandescently lit locations.
The line-break tagCheck out what's happening at our three locations:
San Francisco (Opera Plaza)
Larkspur
Cupertino
Ordering Books
Special Orders
Return Policies
markup to include spaces between entries.
Young Billy Parham traps a she-wolf and decides to return her to the mountains across the Mexican border.
The unblessed, hapless Quoyle retreats to his ancestral home in Newfoundland with his two young daughters and take-charge Aunt. Won the Pulitzer Prize for fiction.
AThe hero's traumatic Vietnam past intrudes upon his present political ambitions in the totally absorbing novel.
. When you use HoTMetaL PRO,
choose Markup>> Insert Element and choose the IMG element from the Insert
Elements dialog box. This displays the Edit URL dialog box. In the Name text box,
specify the path to the image file with the back slash like you would any Windows
path. When you view the URL in HoTMetaL PRO, however, the
Not all browsers can display graphic images. To make sure that others viewing
your page are not left in the dark, choose Markup>>Edit SGML Attribute. This
displays the Edit Attribute dialog box shown in Figure 45.
Figure 4-5: The Edit Attribute dialog box lets you specify text for text-based
Web browsers and other image attributes.
Edit the ALT attribute field to specify text to display in place of the image.
This lets a person viewing the page from a text-based browser, such as Lynx on a
VT100 terminal, see the words "A Clean Well-Lighted Place for Books Logo" at the
location of the logo.
By default HoTMetaL PRO doesn't display the ALT attribute and text. There are
two ways you can see the text that ALT attribute is set to display: choose the
Markup>>Edit SGML Attribute or choose the View>>Show Link and Context View. In
order to see the ALT attribute and text using the Show Link and Context, the
insertion point must be in the line containing the URL for the image.
This adds the logo to the document, so it now looks like Figure 4-6. By
default text is aligned with the bottom of the image. You can choose Markup>>Edit
SGML Attribute to specify that the text is aligned at the top or the middle of an
inline graphic using the ALIGN attribute.
A complete discussion of inline and external graphics is the subject of Chapter
7, "Getting Graphic With Images."
Figure 4-6: A Clean Well-Lighted Place for Books logo is added to the top of the
Web document.
Adding Links
A hyperlink is a term used to describe hypertext or an image in your document
that acts as a pointer to another location or a file. The location could be
another Web document on a remote system, another local Web document or another
part of the current document. The following section explains how to create a link
to another location within the same Web document. Creating links to remote
documents is discussed in-depth in Chapter 5. In order to create a link, you must
identify the destination and create an anchor name that identifies the anchor's
destination. The starting point and the destination points are referred to as
anchors and appear between the and tags. Anchors can include one or more
attributes, but each must have NAME and/or HREF attributes.
The HREF attribute specifies that the anchor is the start of a hypertext link
and is followed by an equals sign (=) and the destination anchor or URL. The
browser presents the text between the and tags as a hyperlink. The text
after the tag and immediately before the shouldn't include any spaces,
otherwise space characters will be highlighted. If the hyperlink text appears at
the end of a sentence, it's good design to put the period directly outside the
closing tag. The path to the destination is established in the document by
including the markup:
Check out our special staff recommendations.
The NAME attribute specifies that the anchor is the destination of the link. In this example, #staff label is used to specify the destination of the link. The words "staff recommendations" appear in the document as the hyperlink text. If you click the "staff recommendations" hypertext, you will be sent to the Anchor with the NAME="staff" in the document. The above is a very simplistic execution of a link. To learn how to link to documents outside your system, or to get a deeper understanding of the linking process, refer to Chapter 5, "The Art of Linking." Adding an Address The tag is usually an e-mail address and is generally used to identify the author of a document or the Webmaster, thereby letting users contact the document's author. The output appears as italic text. In most cases you'll want to use theFor additional information, please send e-mail to jscott@well.com, phone us at +1 415-555-7999, or FAX your request to +1 415-555-6195. If you have problems or comments concerning our Web service, please send e-mail to the following address:
jscott@well.comYou can also contact us via ground mail at
A Clean Well-Lighted Place for Books
Welcome to the Internet home page for A Clean Well-Lighted Place for Books -- a cathode-ray extension of our incandescently lit locations.
Check out what's happening at our three locations:
San Francisco
At Opera Plaza
601 Van Ness Avenue
San Francisco, CA 94102
(415) 441-6670
Larkspur
At Larkspur Landing
2417 Larkspur Landing Circle
Larkspur, CA 94939
(415) 461-0171
Cupertino
At the Oaks
21269 Stevens Creek Boulevard
Cupertino, CA 95014
(408) 255-7600
OPEN 7 DAYS, 10:00 AM to 11:00PM
ītil Midnight on Fridays and
Saturdays
Our staff members (naturally!) read a lot of books. The staff recommendations. is a list of what they feel are the best books they have read in the last year. This briefly annotated list represents only a portion of the diverse books that they championed.
Ordering Books
Special Orders
Return Policies
Young Billy Parham traps a she-wolf and decides to return her to the mountains across the Mexican border.
The unblessed, hapless Quoyle retreats to his ancestral home in Newfoundland with his two young daughters and take-charge Aunt. Won the Pulitzer Prize for fiction.
AThe hero's traumatic Vietnam past intrudes upon his present political ambitions in this totally absorbing novel.
For additional information, please send e-mail to jscott@well.com, phone us at +1 415-441-6670, or FAX your request to +1 415-567-6885. If you have problems or comments concerning our Web service, please send e-mail to the following address:
jscott@well.comYou can also contact us via ground mail at
A Clean Well-Lighted Place for Books