HTML Primer
In HTML there are four characters that should not be used directly. They have
special meanings when written as-is.
< should be written in HTML as < (critical)
> should be written in HTML as > (critical)
& should be written in HTML as &
" should be written in HTML as "
The document should start with <HTML> (first line) and
should end with </HTML> (last line). The document
consists of two basic parts, the heading and the body.
The heading starts with <HEAD> and ends with
</HEAD>. The body starts with <BODY>
and ends with </BODY>.
Except comments and white-space, there should be no characters outside
the heading and the body sections. Comments can be opened
using the <!-- string, and closed using the
--> string.
In the document heading, the document title can be specified.
A title string starts with <TITLE> and ends with
</TITLE>. A title is commonly opened and closed
on the same line.
Bold <B>This text will be bold</B>
Strong <STRONG>This text will be very visible</STRONG>
Italic <I>This text will be italic</I>
Emphasized <EM>This text will be emphasized</EM>
Typewriter <TT>This text will be in typewriter font</TT>
Code <CODE>This text will be program code</CODE>
Strikeout <STRIKE>This text will be striked out</STRIKE>
Headers cause blank space above and below the line.
<H1>Header size 1</H1>
<H2>Header size 2</H2>
<H3>Header size 3</H3>
<H4>Header size 4</H4>
<H5>Header size 5</H5>
<H6>Header size 6</H6>
Addresses will flow to a separate line:
<ADDRESS>user@www.science.uva.nl</ADDRESS>
Á ... Á Â ... Â Æ ... Æ
À ... À Å ... Å Ã ... Ã
Ä ... Ä Ç ... Ç É ... É
Ê ... Ê È ... È Ð ... Ð
Ë ... Ë Í ... Í Î ... Î
Ì ... Ì Ï ... Ï Ñ ... Ñ
Ó ... Ó Ô ... Ô Ò ... Ò
Ø ... Ø Õ ... Õ Ö ... Ö
Þ ... Þ Ú ... Ú Û ... Û
Ù ... Ù Ü ... Ü Ý ... Ý
á ... á â ... â æ ... æ
à ... à å ... å ã ... ã
ä ... ä ç ... ç é ... é
ê ... ê è ... è ð ... ð
ë ... ë í ... í î ... î
ì ... ì ï ... ï ñ ... ñ
ó ... ó ô ... ô ò ... ò
ø ... ø õ ... õ ö ... ö
ß ... ß þ ... þ ú ... ú
û ... û ù ... ù ü ... ü
ý ... ý ÿ ... ÿ in development
Lines in HTML need to be broken explicitly when
you want
this effect
A line break is made using <BR>
A paragraph break is made using <P>
A horizontal ruler is made using <HR>
Pre-formatted text is available. This allows columns. Tabs are recognized.
<PRE>
ITEM PRICE
----------- -------
apples 4.50
cherries 1.23
bananas 3.34
twinkies 1.75
</PRE>
Standard HTML features are supported in pre-formatted mode. It is not like
the LaTeX verbatim mode.
Definition list: <DL>
<DL>
<DT>gnu \'n(y)u:\ n or gnu or gnus [modif. of Bushman
nqu] pl :
<DD>any of several large African antelopes (genera
Connochaetes and Gorgon) with a head like that of an ox,
short mane, long tail, and horns in both sexes that
curve downward and outward
<DT>ox \'a:ks\ \'a:k-s*n\ n or ox.en :
<DD>1: the domestic bovine mammal (Bos taurus); esp :
an adult castrated male 2: a bovine mammal
</DL>
- gnu \'n(y)u:\ n or gnu or gnus [modif. of Bushman nqu] pl :
- any of several
large African antelopes (genera Connochaetes and Gorgon) with a head like
that of an ox, short mane, long tail, and horns in both sexes that curve
downward and outward
- ox \'a:ks\ \'a:k-s*n\ n or ox.en :
- 1: the domestic bovine mammal (Bos
taurus); esp : an adult castrated male 2: a bovine mammal
When the data following <DT> is short, using <DL COMPACT>
will save space.
Unordered list: <UL>
<UL>
<LI>just an item
<LI>another item
<LI>last item
</UL>
- just an item
- another item
- last item
Ordered list: <OL> (same example with UL replaced
by OL)
- just an item
- another item
- last item
List using menu: <MENU>
Directory list: <DIR>
just an item
another item
last item
For directories list items should be shorter than 20 characters.
Lists may be nested.
HyperLinks are made using URLs. A URL points
to a unique resource, for instance:
<A HREF="http://hoohoo.ncsa.uiuc.edu/docs/setup/admin/AccessingFiles.html">URL</A>s
points to the documentation on
URLs.
A URL can consist of connection type, site, directory
and parameters. It has the form:
[con-type:][//host]/[directory][(#anchor|?parameters)]
- Connection Type
-
http - Server needs to be running the HTTP Daemon
-
ftp and file - Anonymous ftp connection
-
gopher, mailto, telnet,
wais
- Site
- Any Internet address will do
- Never abbreviate to www, carol or adam. This is
only filled in correctly by the local name server. If you need to use
a site name, use the full name; e.g.
www.science.uva.nl
- Directory
- The directory name is mapped by the server to some local
disk or directory.
- At FNWI
~user is translated to
/home/user/public_html for http connections.
- Executables in user directories will not be executed by the HTTP Daemon.
- Parameters
- Pointers to anchors (
NAME= fields)
- Parameters to executables
- Imagemap coordinates (two parameters to executable)
http://www.science.uva.nl/ is a complete URL to the FNWI WWW server.
It will address the HTTP Daemon and request the standard
document (index.html) from the root directory of the daemon.
Once on the server, URLs can be shorter. The connection type and
site can be omitted. In the above mentioned document, the URL
http://www.science.uva.nl/about/index.html could be referred to
as /about/
Until here, ftp connections work in the same way. The parameters
however are for HTTP daemons only (pointers to anchors depend on the
browser as well). For further discussion on parameters
read the HTML Primer or the
HTML Quick Reference.
Images can be included everywhere. In pre-formatted text, in HyperLinks or
in normal texts. An image is also specified in URL form. Possible
image types are X bitmaps (by using .xbm extension)
and Gifs (by using .gif extension).
<IMG SRC="http://www.science.uva.nl/pict/telefoon.gif" ALIGN="middle" ALT="o">
This example includes the file /pict/telefoon.gif which is
retrieved from the HTTP Daemon at www.science.uva.nl. It will
be vertically centered with other items on the line
(due to ALIGN="middle"). Parameters for the
ALIGN are top, middle or
bottom (default). The ALT="o" is
specified for HTML browsers without graphics
capabilities. It indicates the the string o should be
displayed as alternative for the image.
Making clickable images is done by placing a HyperLink around the image.
Forms can be made using the
<FORM> ... </FORM> section.
Example documents can be found all through the World Wide
Web. A great starting point is of course our local server.
To view the source for a HTML page, when using Mosaic press
"d" in the document view subwindow or choose
View Source... from the File menu. When using Netscape,
choose Source... from the View menu. When using lynx
press "\" to toggle between the source and the HTML
page.
|