How to make HTML Documents

This is a very brief introduction on how to write HTML documents for the WWW. It was written by
Scott Van Bramer for a faculty development workshop at Widener University.

What is an HTML Tag

HTML is a "markup" language that tells a browser what to do. These tags are placed within < and > symbols. The browser looks for these symbols and uses them as instructions. Most tags include two parts. For example <B>BOLD</B> is displayed by a browser as BOLD. The first tag begins the bold and the tag with the slash [/] is the end of the bold. HTML tags are not case sensitive. <B></B> is equivilent to <b></b>. To see how specific effects are produced, viewer the HTML source for this document.

Look at the HTML code for a web page

Open Netscape and go to any web page. I would suggest looking at the HTML Code Examples at This page provides examples of many HTML codes and shows how they are rendered in the browser. To see the HTML code click on "view" and then "document source". This will display the raw HTML code that Netscape uses to determine the layout of the page. This workshop is to teach you how to write this code. If it looks confusing, don't worry, we will be using some tools to make it easier.

How do you make HTML

HTML documents may be produced several different ways. First, it is possible to simply write the HTML code in any word processor or text editor and save the file in ASCII format. This assumes, however, that you know the HTML codes for everything that you want to do and it is rather painstaking.

The next way to produce HTML documents is using an HTML editor. This is how we will produce documents in this class. In these programs are very similar to a word processor. You write the text that you want. Highlight it with the mouse. Then you apply some characteristic (like bold) to the text. The editor then adds the appropriate tags.

A third way to produce HTML documents is with a converter. This allows you to write the document using your regular word processor and then the converter changes the file (for example a word *.doc file) into HTML code. The problem with these is that I have not yet found one that worked very well or did very much.

Open Web-Edit

For this workshop we will use a program called Webedit to help write HTML. Start by opening up this program and looking at the tools and buttons that are available. This workshop will review the many of these. If you have any questions, there is context sensitive help available online.

Start of with a blank page and add minnimal HTML Tags.

This is easily done with Web- edit by clicking on the [new] document icon and then the [+] to add minimal html. The codes included by Web-edit are:
This indicates the beginning and the end of the HTML markup code. If these are not present, some browsers may display the entire document as text. The <HTML> tag should be the first thing in the document and the </HTML> tag should be the last element.

These tags indicate which part of the document contains the header information. Information between these tags is not displayed by the browser.

<!-- created: 5/9/96 6:05:51 PM -->
Any text within <!-- and --> is not displayed. This is just for comments.

These tags indicate the title of the document. This is displayed at the top of the Browser window, used for identifying bookmarks, and used for searching. The title should be short and descriptive. This tag is important for making a user friendly document.

The body tag indicates the information to be displayed by the browser.

<H1> </H1>
These tags are for a level 1 heading. The effect produced by different leve headings are shown below.

Level 1 Heading

and some text

Level 2 Heading

and some text

Level 3 Heading

and some text

Level 4 Heading

and some text
Level 5 Heading
and some text
Level 6 Heading
and some text followed by a paragraph

and then some more text followed by a line break

This header is centered

This is a horizontal rule

Last Updated: Thursday, May 09, 1996
Provides information about when the document was last updated. This helps readers quickly determine if any changes have been made.

Basics of HTML layout.

Several different codes are available to help with basic document layout. These include:
  1. Headers. <H#> </H#> Where # is any number between 1 (the largest header) and 6 (the smallest header).

  2. Breaks <br>. This tag forces a carriage return in the browser. This is an important consideration in layout because browsers DO NOT pay attention to a regular line feed. Normally a browser will control the line wrap just like a word processor. The <br> tag is equivilent to a line feed.

    1. For example if your HTML document looks like this: A set of lines in an HTML document
      that look like they are divided into three
      lines of text.
    2. Will be displayed by the browser as:

      A set of lines in an HTML document that look like they are divided into three lines of text.

    3. To avoid this the HTML should look like this:

      A set of lines in an HTML document<br>
      that look like they are divided into three<br>
      lines of text.

    4. Will be displayed by the browser as:

      A set of lines in an HTML document
      that look like they are divided into three
      lines of text.

  3. Paragraph <p>. This tag is used to define a paragraph. Text within a paragraph is wrapped by the browser and the end of the paragraph is double spaced. This tag bay be used two different ways. You may simply place a <p> tag at the end of a paragraph. Or you may place the paragraph within a set of <p> </p> tags.

  4. Horizontal Rule <hr>. This tag places a line accross the screen and is very useful for breaking up documents. This is especially important for making a document easy to read on a computer screen. Although a page of text on paper is just fine for reading, it is very difficult to read a page of text on a computer screen. Headers and horizontal rules important for presenting an effective document.

  5. Preformatted text <PRE></PRE>. Browsers normally display text using a proportional font (like the Times Roman Font this document is probably displayed in) where different letters get different spacing. This is usually easier to read, but sometimes it makes it very difficult to setup a document to look the way you want. One point that frequently causes problems for first time users is that browsers will not let you place two spaces in a line. The browser also ignores carriage returns.
     If  you  try  to  do  this.
    The browser will return.

    If you try to do this.

    This may be avoided by using preformatted text.

    This forces the browser to use a typewriter font (like courrier) 
    that looks like this.  Any carriage returns  spacing       like this
    white space is preserved.
    It is not as easy to read, but it is easier to control how something looks.

Basics of text formatting

The following HTML codes are available for controlling the apperance of text.

This text is Bold

This text is italic

This text is superscript

This text is subscript

This text is in a typewriter font.

This text is underlined (Does not work with most browsers)

This makes text blink on and off. This is usually irritating to the viewer and is often a topic of hate mail. Please, only use it if you must.

This text has emphasis (Browser dependent, but usualy displayed as italic).

This text has strong emphasis (Browser dependent, but usualy displayed as bold).

It is possible to specify many different features of a font. Here the font size for the text is increased by 2 points; the color of the text is specified as gray; the font is specifified as Times New Roman (Arial is the alternative if this is not available). Some of these features can cause problems in a document. Specifying a font will cause unpredictable results if the browser does not have the specified font. Specifying a color can cause problems with printing (and can be visually repulsive). For example white text like this WILL not print.

This tag center justifies any text or figures. This tag is only used by Netscape.


These are used to make a series of points for structures similar to an outline. The list consists of several different tags. The list header uses the (<lh>) tag. Each list item is preceded by a list item (<li>) tag. And the list is defined using a list tag. Possible tags include:
<ol> </ol>
This is an ordered list with sequentially labled list items. Ordered lists are useful for laying out an ordered list that looks like this:

    The list header
  1. This is the first point
  2. This is the second point
  3. This is the third point
    1. it is possible to nest points like this subpoint
    2. and this second subpoint.
  4. and return to the fourth point

In a list you may want to specify the type of symbol used for each level.

  1. This list is in capital letters
  1. This list is in small letters
  1. This list is in large roman numerals
  1. This list is in small roman numerals

<ul> </ul>
This is an unordered list for items in no specific order. The next type of list is an unordered list. It is formatted like an ordered list, but the list items are displayed with bullets rather than sequential numbers (or letters). As with ordered lists the default is for the browser to choose the labels, but they may be specified.

<dl> </dl>
This is a definition list which contains the following items
Definition Titles (Major Points)
Definition Items (Indented from definition titles)
The formatting of this list is a little different as is shown below.

This is the first point (definition title)
with one subpoint (called a definition, definition)
the second subpoint shoud be separated by a line break (<br>).
This is the second point
with a subpoint

Links (or anchors).

Links have several different features. They are used to direct a browser to another location. This is the feature that makes the web so useful. These links can be to anything on your computer, your server, or anywhere on the WWW. The URL (Universal Resource Locator) in webedit makes these much easier to produce. Link elements include:

<A HREF="">description</A>
  1. The <A> and </A> is for the beginning and end of the "anchor". An anchor connects this HTML document to something else.

  2. Action. (HREF in the above example)
    1. HREF Hypertext REFerence. Tells the browser that this is a link.
    2. NAME Defines the name of a location within a document. This is then used by a HREF tag to jump to a specific location within a document. The location in the document that you want to reference must have a NAME tag. The syntax for this tag is:

      <A NAME="beginning">

  3. Protocol. (http:// in the above example) This tells the browser what to do with the anchor.
    Chemistry 146 This is a link to a document on a web server. For standard usage the link should be descriptive. Avoid saying "click here", the link is highlighted by the browser and it is obvious where to click.

    Acid Spreadsheet (*.wk4 155k) This is a link to a file on an FTP server. *.wk4 in the name is a clue that this is a Lotus spreadsheet. The 155k is the file size. (this is good form so someone with a modem does not try to download a 10 MB file.)

    mailto:// This link sends an e-mail message using the mail software for the browser. Note: The student labs at Widener are not configured with mail, so do not expect students to use this link in the lab.

  4. The address. This tells the browser where to go. (These may be copied and pasted from the location bar in the browser.) The URL builder is helpful for writing these. Typically the begin with the name of ther server ( and are followed by the file path ( /svb/htmltalk/ ) using the unix / seperator for directories [Rather than the dos \ separator]. If a file is not specified (testdoc.html) the browser will return a directory listing. If there is a file named index.html, that HTML document is returned.

    The address may also specify a location in the document to go to. This location must be defined with a NAME tag (detailed above). There is a name tag at the top of this document and you may use link to go to the beginning of the page. Elements of this tag include:

    <A HREF="#beginning">beginning</A>

    For the address "#beginning". The # tells the browser that this is a location in the document. This location does not have to be within the current document.

    The example show below will jump do a section named "links" in the document "testdoc.html" on the server "" in the file directory "svb/htmltalk". Examples of links The link may also be formated like this: Examples of links. The HTML code for these two examples is shown below:

    <A HREF="">Examples of links</A>

    <A HREF="" NAME="links">Examples of links.</A>

  5. The description. This part is displayed by the browser.


    Most browsers can view two different types of graphics files. These two different file types have different strengths and weaknesses. The figures may be located at any location on the web, you just have to create a link to the file. Keep in mind that graphics files may be very large. This causes very slow downloads that may try a reader's patience.

    Graphics files may be found by searching the web. A number of large libraries are avialable. You may also use clipart, drawing programs, or a scanner to create files.

    GIF (Graphical Image Format). This format works best for line art and small images. The image below is created with the following HTML code:

    <IMG SRC="oldmain.gif" WIDTH=200 HEIGHT=112>

    JPEG (Joint Photographic Experts Group). This format works best for photographs and color images. Some resolution is lost for line art (lines are not a crisp).

    <IMG SRC="oldmain.jpg" WIDTH=540 HEIGHT=303>

    Because images files are very large it is not "good form" to place a large image in a document. A common solution is to use a small "thumbnail" of the image that loads quickly and gives the viewer some idea what the image is. This is linked to the full size figure for interested viewers. Notice the blue border around the image below. This shows that it is a link. THE HTML for this link is:

    <A HREF="oldmain.jpg"><IMG SRC="oldmain.gif" ALT="Text for non-graphics browsers" WIDTH=100 HEIGHT=56></A>
    Text for non-graphics browsers


    Tables are a useful feature for formatting information. These are a bit tricky to set up but with the table builder in Webedit it is easy to get started. The major tags include:

    The tags to define the beginning table, the width, the alignment, the border, and the end of the table.

    The table caption

    A single row of the table.

    A single element (cell) of the table that is a header for a column or row. This element is usually displayed with a bold font and centered in the cell.

    A single data element (cell) of the table.

    A finished table looks like this:

    Table Caption
    Top Col 1 Top Col 2 Top Col 3
    data 1a data 2a data 3a
    data 1b data 2b data 3b
    data 1c data 2c data 3c

    This document was prepared by
    Scott Van Bramer
    Widener University
    Department of Chemistry
    Last Updated: Tuesday, May 14, 1996