A brief introduction to HTML

examples | overview of commands | hints

getting set up | simple text | anchors/links | images | lists | advanced topics

HTML--hypertext markup language--is the language of web browsers. It is essentially a set of instructions indicating how to display text and images to a user, and how to enable the user to easily access other such instruction-sets on the internet.

There are alot of resources available on the internet and one would do well to seek them out. One way to learn about specific features of HTML or web-page design is to find pages which are similar to your desired layout and to view the page source with your browser.

This document contains some rudiments of html, with instructions for how to set up a homepage. These may be valid only locally as different systems are set up according to individual security needs (among other things).

Getting started.

Setting up your homepage in your class account.

On a unix system, cd to your home directory and type
mkdir public_html
Then create a text file (see below, for example) using emacs, and call it index.html. Either create the file directly in your public_html directory or copy it there from another directory with cp.

Before a browser can read your file, you will need to set file permissions. Go to your home directory then enter

chmod 751 .
chmod 751 public_html
chmod 644 public_html/index.html
This ensures that the world has permission to read your HTML file. (Recall how chmod behaves. The 3 digits of its first argument correspond to you [owner], a group [all members of P3730/5720, in our case], and the world, respectively; the numerical value of the digit gives the permissions. For example, the "7" means read+write+execute permission (read=4 + write=2 + execute=1), while a "4" means read-permission only.

To see what your homepage looks like, fire up your browser and enter a URL (Universal Resource Locator) of the form "http://server.domain/~username"; specifically, in the "location" or "open" field of your browser, type

where "user" is your physics username. The index.html file is read in by default. The public_html directory is also a default.

If you wish to view a different file, e.g. my_other_file.html, (or make reference to it within an HTML document) then place that file in your public_html directory and use the URL


Alternatively, you may be able to view your file directly from the browser without having to worry about directory defaults or permissions. Use the "Open...document" menus in your browser or start up a new browser process from a shell using

netscape file.html
This will cause the browser to load up with a display of file.html.

If you have trouble, please contact the instructor or the TA. But first, consider the following.

If you happen to have created an HTML file and have edited it, with emacs for example, yet the browser fails to register any changes even when you've saved the file with the editor and when you've reentered the file's URL, try hitting the "reload" button. If this doesn't correctly refresh the browser, try hitting "reload" while simultaneously pressing on the "shift" key of your keyboard. This forces the browser to read in the file directly instead of using some version it previously loaded and put in some "cache" for its own convenience.

A simple HTML document.

Ok, here is a rather short HTML document:

<TITLE>html example</TITLE>
<H1>An HTML Example</H1>
The things in the angular brackets are called tags. They are commands, usually related to document formatting, that any "compliant" browser can interpret. The full HTML document is bracketed by tags <html> and </html> (to signal the browser that it is indeed an HTML doc); similarly for the header (with title info) and body of the document. The <H1> denotes a Heading/section title (the "1" is the most prominent, large font; "2" would be smaller) while <p> tag denotes a paragraph.

This document would look like:


An HTML Example

Hello world!


The title "html exemple" would likely be displayed on the title bar of the browser, not in the document itself. Note that line breaks and spaces (no matter how many in a row) are treated as a single space between words.

Overview of the most important commands.

Forthcoming is a list of commonly used commands (HTML tags). Meanwhile please look at the file in ~p5720/examples/html-simple.html and click
here to see the effect of some useful tags.


Please let the instructor kmow of any difficulties you may be having. This section will be updated as problems arise. For now, the best hint is to look at page source code with your browser....

bcb 18-Sep-98,15-Sep-00.