Servile Software Guide To HTML Edition 1.0 Compiled by Matthew Probert Disclaimer This document is supplied in good faith, however no responsibility can be accepted for the accuracy of the information contained herein or any loss or damage resulting from any advice given or implied by the author. This document mentions several HTML viewers and companies by name, this is not intended as an endorsment of any company or product. All trademarks are recognised as belonging to their respective owners. Introduction First people communicated ideas through hand signals and voice, then drawings on cave walls then through hand painted manuscripts and later printed paper books and leaflets. With the advent of the computer came the facility to publish documents not on paper, but electronicaly instead. The computer screen displaying the document, rather than it being laid out on a leaf of paper. Publishing information electronicaly requires some medium to present the information to the reader. A graphics viewer is used to access pictures, for example. An HTML viewer (or web browser as they are commonly known) is a program which presents electronic documents, in HTML format, to the reader. The HyperText Mark-up Language (HTML) is a simple data format used to create formatted electronic documents with hyperlinks to other documents and resources (this hyperlinking to other documents is known as hypertext) that are portable from one computer platform to another. That is, an HTML document created on a PC may also be read by a user of a UNIX machine or an Atari, Macintosh and so on. The term "mark-up" is a printing expression describing the process of putting together words and picture to form a document. HTML, is used electronically to put together words (text) and pictures (images) into a finished presentation document. Recent inovations mean that video clips and sound can also be added, making HTML a full multimedia publishing medium. You will probably be familiar with the idea of formatted documents, these are produced by word processors. A formatted document has a variation in its appearance. It looks pretty. Where as an unformatted document has all the text in one style. Links to other documents and resources may be a newer idea for you. A standard formatted document simply conveys information, and may suggest other sources of information to the reader. A hypertext document does the same, but where a suggestion of other information is made a provision is made for the reader to click the mouse button or press a keyboard button and the program being used to view the hypertext document will load and display the linked document. For example, this is a formatted text document that you are reading. If I wish to refer you to another document, titled "order.doc" to view that document you need to select the file option from your viewer software, and open the named file. With a hypertext document, you could simply point the mouse to the words "order.doc" which would be displayed in a different colour, and click the mouse button to ask the viewer software to load and display the document. Of course as the author of the document, I would have to include some instruction to the viewer software that would enable you to do that. These instructions form part of the HTML language. They are called "hyperlinks" and provide a path to other documents or resources, called Uniform Resource Locations, or URLs for short. HTML documents are viewed with an HTML viewer, or "web browser" as they are starting to be known in PC circles. The most common HTML viewers used by PC users are Microsoft's Internet Explorer and Netscape's Navigator. But there are others. Mosaic, by NCSA is available in a number of custom Internet packages including Quarter- deck's Internet connectivity package and is perhaps the next most widely used. What is less well known is that all HTML viewers present HTML documents slightly differently. Although HTML is specified, HTML viewers do not pay too much attention to the official specifications and manufacturers have added support (both documented and not!) for a variety of additional features and commands including built-in Java compilers to understand Java code and support for Frames. If you are publishing your document for a known audience, you should know which HTML viewer will be used to access the document, and you should be aware of the facilities supported by that viewer. When publishing for the World Wide Web you should remember that your audience is comprised of millions of people, with dozens of different HTML viewers, which whilst supporting basic features, have many discrepancies in their support of advanced features. Some may not even have the ability to display images. So while this e-text describes and illustrates many features found only in one or two HTML viewers, it should not be viewed as a recommendation to use these features for general HTML publishing. Basic Concepts As with any aspect of computing, HTML introduces some new concepts and jargon. It is necessary to be familiar with these basic terms in order to understand the rest of this document. Tags: Tags provide instructions to an HTML viewer about elements such as headings, paragraphs, lists, character highlighting, and hyperlinks. Most HTML elements are identified in a document as a start-tag followed by an end tag. The start-tag provides the HTML viewer with the element name and attributes, followed by the content. The end-tag tells the HTML viewer about the end of the element. Start-tags are delimited by `<'and `>'; end tags are delimited by `' and `>'. For example:
and
) tells the HTML viewer that the text contained within the start-tag and end-tag is a paragraph. Paragraphs are displayed by the HTML viewer separated by a single blank line from the preceding items. For example:This is a paragraph. This second line is actually displayed by an HTML viewer on the same line as the previous line, as the carriage return is ignored.
This second paragraph is displayed with a single blank line between it and the previous paragraph.
This results in the following to be displayed by an HTML viewer: This is a paragraph. This second line is actually displayed by an HTML viewer on the same line as the previous line, as the carriage return is ignored. This second paragraph is displayed with a single blank line between it and the previous paragraph. Alignment: Text and images may be aligned to the left, to the right or centred. For example: Left alignment Right alignment Center alignment Lists: A list is simply a list of items. The HTML viewer automatically starts each list item on a new line, and handles list numbering and bulleting depending upon how the HTML author has declared the list. Base URL: The Base URL gives the HTML viewer a point of reference for hyperlinks. Usually the base URL is not specified, and is taken as the URL address of the current document. Hyperlinks: Hyperlinks are a provision allowing the user of the HTML document to navigate through the document and to external resources. Hyperlinks may be local, allowing navigation within the currently loaded document, or external providing access to other documents not loaded and resources such as ftp servers and mail servers. Navigation through hyperlinks usually occurs by positioning the pointer over the link with the mouse, and then pressing the left mouse button. The hyperlink may be displayed to the user either as text, in which case it will normally be displayed in a distinctive colour and underlined, or as an image. In both cases, when the pointer passes onto a hyperlink it will change shape indicating a selectable hyperlink. Meta: The META element is an extensible container for use in identifying specialized document meta-information. Meta-information has two main functions: 1) to provide a means to discover that the data set exists and how it might be obtained or accessed; and 2) to document the content, quality, and features of a data set, indicating its fitness for use. Each META element specifies a name/value pair. If multiple META elements are provided with the same name, their combined contents - concatenated as a comma-separated list - is the value associated with that name. HTTP servers may read the content of the document HEAD to generate header fields from certain Meta information. WWW Search Engines also may make use of META information to automatically build an entry for a site. Forms: Forms provide a mechanism for passing information from the HTML viewer back to a program at the web server or through email to you. A Basic HTML Document A simple HTML document is comprised of the following components: An HTML declaration tag: A heading tag: A title, such as:This is an example HTML document.
Notice the use of the paragraph start-tagand end-tag
which tells the HTML viewer to display the text as a new paragraph, and not as a continuation of the heading line. Newer HTML viewers, such as Netscape Navigator and Microsoft Internet Explorer aslo support more advanced formatting for headings and other text, but this will be covered later. Simple Formatting HTML viewers do not recognise carriage-returns in the text. Instead, they display the text as continuous lines, breaking each line at a word end so that it fits in the text window. This is known as word- wrap. You can force a line break with the HTML tagThis is an example HTML document.
If you just want to centre a single heading, you can use the "align=" command within the heading tag, for example:This is an example HTML document.
This will display as: Main Heading This is an example HTML document. The ALIGN= command may also be added to the paragraph tag,to align an entire paragraph, for example:
In addition to defining the size of the typeface used to display text (heading), HTML also supports bold, italic, strikethrough, underline, subscript and superscript formats. The following example illustrates the popular formatting tags:
This is an example HTML document illustrating some basic text formatting tags.
Bold
Italic
Subscript
Underline
Superscript
Strikeout
Typewriter (fixed width font)
Preformatted (used for displaying source code etc.)Formatting tags may also be nested to create multiple effects such as BOLD ITALIC, for example: This is Bold Italic But you must remember to end-tag in the reverse order to the start- tags to keep the nesting correct. Blockquote: Text defined as a "blockquote" is displayed as a new paragraph, and usually displayed indented from the left margin, and with some HTML viewers in a unique typeface. A blockquote is declared by the tag pair
and, for example:
This text will normally be displayed indented, and if viewed with Mosaic, displayed in a unique font type face.Address: Text defined as an "address block" is displayed as a new paragraph and usually in italic. An address is declared by the tag pair and , for example: This text will normally be displayed in italic. Emphasis: Emphasised text is declared by the tag pair and and is usually displayed in italic. Strong: Strong text is declared by the tag pair and and is usually displayed in bold. Citation: Citation text is declared by the tag pair and and is usually displayed in italic. Source Code: Source code is declared by the tag pair
and and is
usually displayed in a fixed width font, though this may be changed by
the user of the HTML viewer.
Sample Output:
Sample Output is declared by the tag pair and and is
usually displayed in a fixed width font, though some HTML viewers
(notably Mosaic) allow the user to change this.
Keyboard Input:
"Keyboard Input" is declared by the tag pair and and is
usually displayed in a different font face and style to the ordinary
text.
Variable:
Variable text is declared by the tag pair and and is
usually displayed in either a fixed width font or an italic font to
emphasis it.
Big:
Big text is declared by the tag pair and and is usually
displayed larger than the ordinary text, but without the new line
which accompanies a heading and
tag pair, although the end-tag is not needed if another paragraph starts with astart-tag. Paragraphs may be aligned, with the "align=" command, for example:
A standard paragraph
Center aligned paragraph
Left aligned paragraph
Right aligned paragraph
Line breaks are enforced with the
tag. When an HTML viewer
encounters the
tag, the cursor is moved down one line and to the
left of the window. If an alignment is in operation, the next
displayed line will be aligned correctly.
Horizontal rules are affected with the
Will cause the HTML viewer to display the image "picture.gif".
Some HTML viewers cannot display images, so you can provide text which
will be displayed by these viewers instead of the image by including
it with the "alt=" parameter, for example:
The image may be aligned in relation to the surrounding text using the
optional "align=" parameter. If no alignment parameter is specified,
text following the image will be displayed at the bottom right of the
image. Different HTML viewers handle the alignment of text and images
differently, so be careful!
The size of the image can be declared to the HTML viewer with the
optional "width=" and "height=" parameters. If these are not
specified, the HTML viewer will display the image at its full size. If
however you specify these size parameters, the image will be displayed
to the specified size in pixels. For example:
Lists
HTML supports a number of types of list: Ordered, Unordered,
Definition, Menu and Directory.
Ordered lists are displayed one item per line, with a sequential
numbering system to the left of each item. An ordered list is declared
by the start-tag
Local hyperlinks:
Local hyperlinks, known as "Fragment Identifiers", are defined in a
hypertext address by a # character following the resource. If
navigation is required within the local document, the resource may be
omitted so that a local hyperlink may look like:
Introduction
Selecting this hyperlink will cause the HTML viewer to search the
current document for a declaration of "introduction". This declaration
is achieved with the anchor name tag , like this:
Notice that the tag does not have an end-tag, and is case
insensitive. It doesn't matter if the anchor name is declared as
"INTRODUCTION" or "Introduction" or even "introDuction" it will still
be found by a hyperlink to "#introduction".
Local hyperlinks can be added to hyperlinks to external documents to
force the HTML viewer to load an external document and then navigate
straight to a desired section within that document.
For example:
Life and Love
Will create a hyperlink to the anchor "section_3" within the HTML
document "part_two.htm".
The following HTML document illustrates the use of local hyperlinks to
form a table of contents to a document. Although this document is very
short, you can see how the principle can be applied to longer and more
complex documents.
In Norse mythology, Aegir is the god of the sea.
Aesir
The Aesir were the principal gods in Norse mythology.
They lived in Asgard.
Asgard
In Norse mythology Asgard was the home of the gods.
Balder
In Norse mythology, Balder was the son of Odin and Freya and husband
of Nanna,
and the best, wisest, and most loved of all the gods. He was killed,
at
Loki's instigation, by a twig of mistletoe shot by the blind god
Hodur.
Berserker
In Norse mythology, a Berserker was a warrior whose frenzy in battle
transformed him into a wolf or bear howling and foaming at the
mouth,
and rendered him immune to sword and flame.
Bertha
In Norse mythology, Bertha is the goddess of spinning.
Bragi
In Norse mythology, Bragi is the god of poetry and eloquence. He was
married
to the goddess Iduna who dwelt in the underworld.
Netscape introduced a number of new commands for hyperlinks. TARGET=
can be used to open the hyperlink document in a new instance of the
HTML viewer, or a specified frame. More about frames later. For
example:
Next Document
When the hyperlink "Next Document" is selected, the document
"next.htm" will be opened and displayed in a new instance of the HTML
viewer.
Hyperlinks are not restricted to other HTML documents. They can be
used to access news servers, gopher servers, send mail and access ftp
servers.
A hyperlink to send mail uses the URL "mailto:"
For example the following link attempts to send an email message to
me:
Feedback
Some HTML viewers will also support the addition of an optional
subject, to save the user typing it in. For example:
Feedback
Files can be sent to the user through FTP links, to send a specific
file, use something like:
< A HREF="ftp://server/path/filename">Download file tag, but with the addition of the USEMAP command to indicate
that the inline image is an image map. For example:
The map component may be processed by the HTML viewer (a client side
image map) or by the HTTP server if the HTML viewer cannot process
maps.
A server image map is defined by adding the command ISMAP to the
tag, for example:
In this case, the HTML viewer will expect the map information to be
processed by the server.
A client side image map (CSIM), however, is a map processed by the
HTML viewer, which gets the map information from an HTML document
found by the hyperlink following the USEMAP= command, in this case it
follows later in the same document, and occurs between the tags:
The first line tells the HTML viewer that this is a map, and assigns
it a unique name, in this case "sample". The next three lines define
three link areas within the image. Each area is defined with one the
forms:
or
or
These co-ordinates are pixel co-ordinates within the image and define
a region within which the link occurs. The SHAPE=RECT command expects
a rectangular region described by two pairs of co-ordinates. The
SHAPE=CIRCLE command expects a circular region described by the co-
ordinates of the circle centre, followed by the radius. The final
example, SHAPE=POLY describes a multi-sided area.
Here is the complete HTML example with blank lines inserted to make it
easier to read and determine the individual areas:
This Is An Image Map Example
| This is a table! |
|---|
| This is a table! |
| Cell One is aligned to the left and in the centre vertically |
Cell Two
has multiple lines in it and is displayed to the left of the cell |
|
Cell Three is centred horizontally,
at the top of the cell |
Cell Four is another
multiple line cell displayed to the right |
| Protoplasm | ||
|---|---|---|
| Plants | Invertebrates | Vertebrates |
| Protoplasm | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Single-cell Plant Animals | Bacteria | ||||||||||||||||||||||||||
| Invertebrates | Fungi | Vertebrates | Sponges | ||||||||||||||||||||||||
| Ringed Worms | Jelly fish | Mosses | Sharks | Sea Squirts | Lancelets | ||||||||||||||||||||||
| Cone shells | Spiders | Snails | Insects | Conifers | Ferns | Flowering Plants | Amphibians | Bony Fishes | |||||||||||||||||||
| Reptiles | Newts | Frogs | |||||||||||||||||||||||||
| Mammals | Crocodiles | Lizards | |||||||||||||||||||||||||
| Ungulates | Carnivores | Apes | Rodents | Marsupials | |||||||||||||||||||||||
| Cattle | Deer | Cats | Civets | Weasels | Monkeys | Gorillas | Man | ||||||||||||||||||||
| , | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| tags, with the colour defined in the last element over-riding those defined before. E.g. if a | element contains a BORDERCOLOR attribute setting, the setting specified will be used instead of any colour settings that may have been specified in the | |||||||||||||||||||||||||||||||||||||||||||
| and | tags. If used in the
|
|---|