HTML documents are basically plain-ascii text documents in which you
put tags to indicate special formatting or features.
All HTML tags are surrounded by the characters "<" and "> ". For
example, the tag which marks a line break is <br> .
Two additional things to know about tags in general are:
Some tags have options. The basic format of such tags
is <TAG OPTION=VALUE> (you can put VALUE in quotes, but
don't have to). For example.
Tags which mark up a block of text come in pairs, like this:
<TAG> text text text </TAG> . That is, the end of the
text block is marked by a tag identical to the one at the beginning
except that you put a "/" before the name.
Here are two two tags you'll be using in almost every document.
<title> DOCUMENT TITLE</title> : It is not
necessary to give a document a title, but you generally should.
The title you give the document will be displayed at the top of
the browser window when people look at it.
<p> : This tag marks the end of paragraphs.
A blank line by itself does not mark a paragraph, and will
be ignored by the browser.
Here are some others which will give your document some structure:
<h1> SECTION TITLE</h1> :
Use this to mark a section header. The browser will present the text
in bold and/or in a large font if possible.
<h2> SUBSECTION TITLE</h2> :
Use this for the title of a section division less important than
the one marked by "h1" tags. You can continue to break things down
all the way to "h6".
<hr> : This stands for "horizontal rule" and tells
the browser to draw a horizontal line across the page.
<center> TEXT </center> : Center the text
between these two tags.
You can use the tags below to tell the browser to put text into a specific
typeface. But keep in mind that these are all subject to different
implementations in different browsers, particularly "lynx", which
obviously has a limited number of options.
<b> TEXT</b> : Make text bold. (But actually
comes out as underlined on lynx).
<i> TEXT</i> : Make text italicized.
<em> TEXT</em> : Emphasize text;
however the browser sees fit!
<tt> TEXT</tt> : Print text in
Makes a link which, if clicked will cause the browser to
make a web connection to the computer "xyzzy.ucsb.edu", get the file
"plugh.html" from the directory "/pub/www/docs", and go to the link named
As noted by the parentheses, a URL does not need to be complete. Here are
some examples of how URL's can be abbreviated:
href=otherdoc.html: If you just specify the name of another
document, without saying on what machine or in what directory,
the browser will look for that document in the same directory
and on the same machine as this one.
href=/www/docs2/nutherdoc.html: If the document is
on the same machine but in another directory, you can give the
href=../docs3/three.html: You can also refer to the
relative path of the document.
Note that if you want to refer to a document in the same directory as the
one with the link, it is better to use just the document name as in (1)
than the full path since that way the link will remain valid even if the
documents are moved to a different directory.
By adding #LINKNAME to a URL, you tell the browser where to go in a
document. This option can be added to a full URL or to a URL in any of
the abbreviated forms above, or can be used just by itelf to refer to a
location with the current document. Thus, if a user selects a link like
the one below:
Click here to go somewhere else in the current document!</a>
The browser will search the current document for a tag like this:
There are two ways to include documents in your web site.
The first way is to just have a link to the document. For example, with
<a href=picture.gif> Click here to see a pretty picture.</a>
The user will be able to click on the link, and the browser will load up
The advantages of including pictures this way are that (1) If the picture is
really big, then the user can skip it. (2) If you have the right
configuration its possible to see the picture this way even if you're using
lynx (you can set it up to call an external viewer program).
To actually include a picture in your document proper, use the "img" tag
As with filenames in URL's, you can either just list the name of the
file, to specify that the picture file is in the same directory as the
current document, or put an absolute or relative path.
The usual formats for images in web documents are .gif and
.jpg. It is best to use .jpg files because they are the
most compact. To convert between these formats, any many others
including .bmp, you can use the program xv3.
Note that you can put image tages inbetween the <a> and </a> tags
of a hypertext link to create clickable "buttons".