NCSA Mosaic for Microsoft Windows User's Guide

Seven Basic HTML Commands

This section presents seven HTML commands, or command pairs, with which you can build simple HTML documents. But first, there are several simple concepts may reduce later questions:

Title

Every good document has a title. Designate the title of a document by prefacing the title text with the <title> command and ending it with the </title> command. For example:
    <title>How To Create HTML Documents</title>

Headers

You can have up to six levels of headers with 1 being the most prominent and 6 the least prominent. Preface the header text with the desired header value, such as <h2>, and end it with the parallel closing command, in this case </h2>. For instance,
    <h2>Tutorials</h2>

Paragraphs

All text in an HTML document is packed together in one continuous paragraph unless you declare it to be otherwise. Indicate the end of a paragraph with the <p> command. This will force both a carriage return and a line feed to be inserted. Note that <p> is an exception to the rule that HTML commands come in pairs; there is no accompanying end command (e.g., </p>).

Hyperlinks

You may want to offer the reader a chance to jump to another file within the World Wide Web. There are two parts to this process: the anchor and the reference. The anchor is the hyperlink that the reader will see and click on to access the file. The reference is the full network pathname of the file (the Uniform Resource Locator, or URL) to be linked. Consider this example:
    <a href="http://www.ncsa.uiuc.edu/Edu/EduHome.html">NCSA Education Group's Home Page</a>

The words "NCSA Education Group's Home Page" will appear in color and/or underlined within the NCSA Mosaic document view window since they are designated as the anchor. The reference, or URL, designates that the file EduHome.html in the directory /Edu on the HTTP server www.ncsa.uiuc.edu will be accessed when this hyperlink is selected.

You can link to any type of file, whether it is another hypertext document, a regular text document, an image, a sound, etc. Since there are different types of servers, you need to specify which type of server is holding the desired file. Four common types are:

HTTP
http://
Anonymous FTP
file:// orftp://
Gopher
gopher://
Telnet
telnet://

If you want to link to a file that resides on the same machine and in the same directory as the current document, then just use the name of the file:

    <a href="HTML_Advanced.html">HTML Advanced Guide</a>

If the file resides in a subdirectory of the current document directory, then you may leave out the server type and machine name and begin the URL at the first subdirectory:

    <a href="OtherGuides/HTML/HTML_Advanced.html">HTML Advanced Guide</a>

Inline Images

To include an image within a document, use the command <img src="filename"> where filename is the name of the image file. For instance,
    <img src="logo.gif">

will display the image file called logo.gif from the same directory as the current document. If the image file is in a different directory or on a different server, include the image's URL. For example,

    <img src="http://141.142.20.152/document_images/logo.gif">

The inline image command is another exception to the rule that HTML commands come in pairs.

Lists

The two most common types of lists are ordered and unordered lists. Items in an ordered list are automatically preceded by a number, while unordered list items are preceded by a bullet. You start ordered and unordered lists by using the <ol> or <ul> commands, respectively. In both lists you use the <li> command to distinguish each item of the list. End the list with a </ol> or </ul> respectively. For example, an unordered list might look like this:
    <ul>
    <li>Champaign
    <li>Urbana
    <li>Danville
    </ul>

The<li> command is also an exception to the rule that HTML commands come in pairs.

Bold or Italic Styles

Enclosing text with <b> and </b> will cause the text to appear as bold.

Enclosing text with <i> and </i> will generate italic text.


National Center for Supercomputing Applications / mosaic-win@ncsa.uiuc.edu