Science and Computers -- PHY307/607
Simple HTML Reference
Web pages are constructed using the HyperText Markup Language HTML. This
is a formatting language that describes how the various elements of
a Web page should be rendered by the browser program. That is, it
indicates the relative positions of various items of text and graphics -
it does not specify details such as font, fontsize and color - such
decisions are left to the browser. The idea is that this scheme allows
the pages to be truly platform independent - a user's browser program
substituting the most suitable fonts and colors available. It also
renders it simple and easy to learn.
Formatting actions are determined by the use of tags. These can be
of two types: empty tags and container tags. Examples of
the former include the paragraph tag <P>, the
horizontal rule tag <HR> and the
line break tag <BR>. These are one-time instructions that
the browser will obey.
Graphics may inlined using the image tag <IMG>. For
example the file me.gif can be inlined to the page with the
tags
<IMG SRC="me.gif" HEIGHT=100 WIDTH=50 >
Container tags specify formatting or
construction for a range of selected text and graphics. They
come in two types - beginning and ending. For example,
the tag <H1> delineates the beginning of a heading
and </H1> the end.
One special type of container tag is the anchor <A>
tag - this is
used to create a hyperlink - a highlighted piece of text or
graphics which when clicked causes the browser to download the new Web
page pointed to by the link. An example of such an embedded link might
be
<A HREF="x.html">This is a link to the html page x.html </A>
Container tags can be nested - they may also contain empty tags.
The following are commonly used container tags
- <H1>--<H5>.
- Different sizes of heading font - from largest to smallest.
- <UL>
- Creates an unordered list with list items specified by the <LI> tag.
- <OL>
- Ordered list.
- <DL>
- Glossary list - elements are specified with the <DT> tag followed
by inset descriptions marked with the <DD> tag.
- <TITLE>
- The title tag.
- <BODY>
- The tag surrounding the body of the Web page.
- <HEAD>
- A tag enclosing the TITLE and other preface tags.
- <APPLET>
- This tag allows one to embed a piece of Java code
directly into the Web page.
A basic document template is given below. Note that these html instructions
would be placed in a file called, for example, myfile.html.
<HTML>
<HEAD>
<TITLE> Some title or Other </TITLE>
</HEAD>
<BODY>
This is where your HTML goes
</BODY>
</HTML>
There are many more tags (particularly in the new HTML 3.0 specification)
allowing for forms and tables, clickable image maps, customised bullets and
a whole host of other features to
be constructed. Documentation on these can be obtained from the Web.
A good source of links for HTML info can be found
here.
Back to the PHY307 Homepage
This page maintained by Simon Catterall, last updated 21 August, 1997.