Very basic HTML reference

Contents
Commands Headings Lists Images
Anchors URLs Tables Sources and Tools

HTML stands for `HyperText Markup Language'. It was designed for creating documents that would look nicer than plain text, but could be displayed on various hardware. It also allows to create `links' from one place of the document to another, or even to other documents and services available on the network.

Introduction to commands

HTML uses simple commands to indicate how text should look. All HTML commands (usually called `tags') are enclosed in angle brackets <...>. Like TeX, HTML normally doesn't pay attention to spaces, line breaks etc. in your document. For example, you have to tell it to break a line right here
by inserting the tag <br>. To start a new paragraph, you use <p>.

Some commands which enclose a portion of the text (e.g. making it bold, or specifying a large-type heading, must have a beginning tag and a corresponding end tag. For instance, <em> starts slanted type (`emphasis'), and </em> ends it. In normal use you only need to remember a dozen or so such commands.

Headings

Headings are produced by <h1>...</h1> (very large), <h2>...</h2> (somewhat smaller), down to <h4>...</h4>. They automatically give a paragraph break. You can include certain formatting tags within a heading, e.g. a line break.

Lists

There are several types of lists in HTML. The two most commonly used ones are `unnumbered list' specified with <ul>...</ul>, and an `ordered (numbered) list': <ol>...</ol>. Inside these tags, individual items are started with the `list item' tag <li> (the closing </li> tags are optional here).

Images

You can include graphic images (icons, pictures etc.) at any point by saying <img src="filename">, where filename is a file containing the picture. There are several alignment options which can be applied here to control the position of the image, and you need to know how the Web server under which the document is viewed will interpret the location of the file on the system. Ask your local computer nerd when you get to this stage.

Anchors

In HTML slang, pointers to other documents or places on the network are called `anchors'. When the document is viewed with a Web browser, they appear underlined or highlighted in some way, and the user can click on them and go directly to wherever the anchors are pointing to.

The simplest one is a `name', which lets one jump around in the document. I put the tag <a name=start></a> at the very beginning of this file. Now I will put in the anchor tag <a href=#start>, then the words `example link', and then the closing tag </a>: example link. If you are viewing this with a Web browser, you can click on that link and see what happens.

A slightly unusual but frequently used anchor is the one which sends mail instead of taking the user somewhere. It looks like this: <a href=mailto:behr@math.niu.edu>, closed as usual by </a>. The text (or image, or whatever) enclosed by these tags will become highlighted, and clicking on it in a Web browser will open up a mailer window, allowing you to send a letter to the specified address.

URLs

An anchor tag can also point to other documents on the local computer, or to things on other computers. To specify such `remote' links in the anchor tag, we must know a bit about URLs, or Uniform Resource Locators. The text which starts with href= is supposed to have certain standard format.

In the example above, the # indicates a named place in the current document; href="filename" would point to a file on the local machine, in the current directory (the quotes around the name are usually not required, but it's safer to use them); href="filename#label" is a link to a point in another file marked with the label (i.e. would try to find the tag <a name=label> in the file filename.

The URL can point to a specific resource on another computer. In general, the format is:
[type of service]://[name of computer]/[path to a file]

For example, http://math.niu.edu/local/media-eqpt.html says: contact the WWW (Web) server running on the computer math.niu.edu using the HTTP protocol, and ask it to retrieve the file media-eqpt.html from the directory local. Many other services can be used in URLs: telnet, ftp, gopher, and so on.

Tables

The basic table starts with the tag <table>, and there must be a matching end tag. In between the tag <tr> indicates the start of a new row, and <td> begins a new cell (`table data'). There are dozens of additional parameters which can be added to these tags to control the layout, borders, distance between cells etc. See the examples provided by Netscape Corporation for more details.

Sources and Tools

When you'll want to know more about HTML, you will need to access more complete documents. Here is a short list: There are two tools on our system which will be of special interest to HTML writers. The first one is weblint, which does a good job of checking the syntax of your documents. The other is webxref; it goes through the specified HTML files and checks the validity of links within them. See man weblint and webxref -help for more details.

Go back to the start of this document
Back to the NIU Math Web page