Using The Web in ICS


Using Netscape

Netscape allows the user to determine what page to display when it starts. This is done by setting the "home page" by using Style Preferences (under the Options Menu). The ICS home page, http://www.ics.uci.edu, is one good starting point.

From there, one traverses the web by either clicking on links (that usually appear underlined), using the Back and Forward buttons, using bookmarks (saved addresses of pages that the user has visited before), or opening a new URL. ICS, UCI, and many places on the web keep lists of interesting or useful Web sites.

A URL (Uniform Resource Locator) provides a consistent method for naming any page on the Web. It consists of a protocol (e.g., http, ftp or gopher), a host name (e.g., www.ics.uci.edu), and the directory and file name. For example, the following are all valid URLs:
http://www.uci.edu/
gopher://ka.reg.uci.edu/11/ro/soc/
http://www.mit.edu:8001/people/cdemello/univ.html

If you need to guess a URL for a university, try http://www.UNIVERSITY.edu
For a company, try http://www.COMPANY.com
For a department at a university, try http://www.DEPARTMENT.UNIVERSITY.edu
For a person at a university, try http://www.DEPARTMENT.UNIVERSITY.edu/~LOGINNAME


Putting Information on the Web

To add something to the ICS home page requires the "privileges" of a "webmaster." This is needed to insure that the information is put in the right place, is an "official" ICS document, looks professional, and doesn't contain any errors. However, it's easy to set up your own personal directory on the web, and use this to test things out. When things are ready, send mail to webmaster@ics.uci.edu and ask to have it copied to the official ICS web pages.

(By the way, a program has been set up to add yourself to the ICS Directory Service for ICS staff, faculty and grad students. This creates a personal home page for you, and in the next part, it helps if you have a home page set up already. Once you learn HTML, you'll probably want to edit the file for your home page by hand. For staff, it can found in the ~www/documentroot/dir/staff/ directory.)

In our webserver, if you have a directory named public_html, in your home directory, then files in that directory can be accessed with the URL http://www.ics.uci.edu/~LOGINNAME/FILENAME.html . The directory should be readable and searchable by others, and all files should be readable. Here's one way to create the directory in UNIX:

 
mkdir ~/public_html
chmod a+x ~/public_html 
chmod a+r ~/public_html

HTML

HTML stands for HyperText Markup Language. An HTML document does not describe how a page is to be displayed (unlike WYSIWYG editors). Instead, it describes the logical structure of a document by having tags that describe parts of a document. A tag is command, such as <TITLE> which defines the title of an HTML document. Tags usually come in pairs, e.g., one to start a title <TITLE> and one to end a title </TITLE>. All closing tags begin with a "/". The case isn't important so <title> and <TiTLe> are also acceptable. A HTML file should begin with <HTML> and end with </HTML>. The name of a HTML file should end with .html. For example, the name of this file is ~pazzani/public_html/WWWintro.html and the URL for the file is http://www.ics.uci.edu/~pazzani/WWWintro.html

The Structure of an HTML document

An HTML document has two parts: a head and a body. The head contains information about the document (e.g., its title), and the body includes all of the text and other information. The head comes first and is surrounded by the <HEAD> and </HEAD> tags. The body comes after the head and is surrounded by the <BODY> and </BODY> tags.

Getting Started: A Few HTML commands for the body

Headings (and subheadings) are used to divide sections of text. HTML has six "levels" of headings, indicated by <H1>, <H2>, ... <H6>. For example, the heading for this section is:
<h3>Getting Started: A Few HTML commands for the body</h3>

The tag <p> begins a new paragraph. The command is optional after a new heading. The closing paragraph tag <p> is also optional.

The tag <HR> draws a horizontal rule (i.e., line). The is no need for a command to end the line.

The tag <BR> causes a line break. There is no need for an end command.

An address is surrounded by <ADDRESS> and </ADDRESS> tags.

Putting it all together: An example HTML document

The tags above are enough for creating many HTML documents. For example, a simple template for an HTML document looks like this.

Note that the document ends with a horizontal line followed by information about the author. This is a standard convention on the web, and it's useful in making documents look uniform. Don't worry if you don't understand everything after the horizontal line yet. One way to make documents look uniform is to have a standard template for documents, and to copy that template when creating a new document. You are welcome to copy the file ~pazzani/public_html/template.html, and personalize the end to create your template. The following UNIX command achieves this:

 cp ~pazzani/public_html/template.html ~/public_html/template.html 
If you have run the ~www/bin/icsds program, the URL for your home page is http://www.ics.uci.edu/dir/staff/YOUR_LOGIN_NAME

Some more HTML commands

Sometimes, you want to maintain control of how text is formatted, for example, to make items line up. The tag <PRE> starts a section of preformatted text, and the tag </PRE> ends one. For example,
<PRE>
YEAR       FACULTY        FUNDING (In Millions)
1995       24             $4.5
1996       27             $5.4
1997       30             $6.4
1998       31             $8.2
1999       33            $10.1
</PRE>
There are two types of lists commonly used. Unordered lists have items separated by a bullet. Ordered lists are numbered. Unordered lists are surrounded by <UL> and <\UL>. Ordered lists are surrounded by <OL> and </OL>. In both ordered and unordered lists, new items start with <LI>. There is no closing tag, and you shouldn't use <p> to start a new item. You may embed lists inside of lists (as shown at the end of this document). Here's an example of creating a list.
<UL>
<LI>First Item
<LI>Second Item
<LI>...
<LI>Last item
</UL>
and heres how it would look: This is just a introduction to HTML, see HTML Primer or HTML Course for more tags. Another way to learn HTML is to view the source of other pages.

Adding links to other documents

The tag <A> is used to create links to other documents. It's a little more complicated than other tags, because it has some attributes. The simplest form of this tag is
<A HREF="URL">Name of Link to be displayed</a> such as
<a href="http://www.ziff.com/~eamonn/crash_course.html">HTML Course</a>.

The URL in the link tag can be a full URL or a relative path name. If you want to link to another document created by you and stored in the same directory, a relative URL is preferred. This is simply the name of the file, such as
<A HREF="Places.html">Useful Places on the Web</a>. Relative path names make it easier to move a group of files from one place (e.g., your public_html directory) to another (e.g., the ICS Home page).

There is a special format of a URL that allows a user to send mail to a specified address. This is <a href="mailto:mailaddress">Text to display</a>. Usually, the text to display is the same as the e-mail address:

<A href="mailto:webmaster@ics.uci.edu">webmaster@ics.uci.edu</A>

Adding Images

Most Web browsers are set up to display GIF (Graphic Interchange Format) pictures. On the Sun, xv can convert many formats to GIF. On the Mac, GIFConvertor can convert PICT files to GIF. Most Mac graphic programs can output PICT files. GIFConvertor can be found in the faculty staff exchange folder of the 4th floor file server. If you transfer GIF files from a Mac to UNIX, make sure you use binary transfer (if you use ftp), or Raw mode (if you use fetch). Under UNIX, make sure the extension of the file is ".gif" and make sure its lower case.

The tag <IMG> creates an image. Its usual format is <IMG SRC="URL">. Like links, you may use a relative pathname or a full URL. For example, you could use
<IMG SRC="http://www.ics.uci.edu/~pazzani/BW.gif"> to include a picture of me in your document.

Alternatives to Creating HTML by hand

There are translators that create HTML from LaTex, and others from RTF (Rich Text Format, that can be exported from Microsoft Word). The HTML output usually requires hand editing and I recommend avoiding them unless you have a large number of long documents to translate.

Another alternative is to store documents in Postscript and to link to files with a ".ps" extension within your HTML. This allows a user to download and view or print the postscript. Postscript created on the Macintosh tends to be less portable than that created by LaTex.

Common Errors

URL not found on server errors are usually caused by having an incorrect URL in a HTML document. Make sure a URL is enclosed in double quotes, and pay attention to the case of the letters. Make sure your HTML files end in ".html". These errors may also be caused by having the wrong protection on a file or directory. If you store all your HTML files in your public_html directory, the following UNIX command will make them readable:
chmod a+r ~/public_html/*
Other errors usually show up as poorly formatted documents. Most browsers ignore tags they don't recognize, so make sure that tags and if necessary the corresponding closing tag are present and spelled properly. Also make sure that all open quote marks have corresponding closing quote marks.

One way to check your HTML document is to submit it to a validation service, such as the one at the bottom of this document.


Topics for Discussion


Michael Pazzani
Department of Information and Computer Science,
University of California, Irvine
Irvine, CA 92717-3425
pazzani@ics.uci.edu

HTML 2.0 Checked!