Easy HTML: Creating Simple Web Documents with HTML Tags

Aurora University
Information Technology Services
Rev. 10 July 2008


The World-Wide Web has had a profound effect on how people communicate. The web is a powerful publishing environment, interactive tool for information exchange, reference library, advertising medium, archiving system, and entertainment source. Publishing has never been easier, cheaper, or more powerful. It is well within the range of anyone who can use a word processor to create effective web documents using Hypertext Markup Language (HTML), the coding system on which most web communication is based. The purpose of this guide is to help you get create simple HTML-encoded documents. This is only a basic introduction to a markup system that has many refinements. A variety of detailed reference sources are available (a few are cited at the end of this guide).

How the Web Works

The Internet is a global network of many different types of computers all talking the same language. This network-of-networks is the infrastructure on which a variety of applications coexist. One of the fastest growing of these applications is the World-Wide Web, a document-distribution environment which is based on two basic principles. The first is that a user at one location on the Internet, using a common set of rules of exchange, can send a document request to a remote computer, which responds by delivering the requested document directly to the originating computer, where it can be displayed, and optionally printed or saved to disk. The second is that all the documents exchanged in this way are constructed using the same formatting language (HTML), which minimizes the problem of software/document incompatibility. Web communication involves two types of computers:

Clients and servers communicate over the Internet using a naming and addressing system, not unlike a telephone or postal system, that makes it possible to uniquely identify a document from all the documents stored on all the servers in the world.

Creating HTML Documents

An HTML document is essentially a simple text file to which have been added specific codes, or "tags." The HTML tags imbedded in the document tell the browser (which receives the document over the Internet) how to process the file for display. The tags encode features of the document similar to the way word processors insert codes that control the appearance of the document, except that, unlike word-processor codes, HTML tags are plain-text alphabetic codes that can be displayed and edited in almost any editor. Another important feature of HTML codes is that they are not platform-specific. Browsers running on radically different computers all recognize the same basic set of tags, and treat them in more or less the same way. The paragraphs below describe how to produce and publish a simple HTML-encoded document.

Step 1: Create the Document

You can create a valid HTML document using any editor or word processor, as long as you save the file, not it its native word-processing format, but as a plain-text or "ascii" file (this is available as a save option in any word processor). If you were to save your document, for example, as a Microsoft Word file, even if the HTML tagging were correct, the added MS Word formatting information would make the file unreadable to browsers. In addition, HTML files should be saved with the extension .html or .htm, so that the browser will recognize them as HTML documents.

It is possible to create HTML documents on a variety of editors:

Step 2: Test the document

Particularly if you are creating your HTML document using a plain text editor, you will need to periodically view the document through a browser to make sure the tags are doing what you intend for them to do. Fortunately, even with plain text editors it is possible to accomplish this without going to the trouble of moving your file onto the server. If your computer has one of the standard web browsers such as Netscape Navigator or Microsoft Internet Explorer, you can use it to display HTML-encoded files stored on the local on the desktop. In Netscape, for example, use File - Open Page - Choose File, and select the file from the local directory display. In Windows, you can run the editor and the browser at the same time, each in its own window, and switch back and forth between the programs to monitor your progress.

Step 3: Load the document on the server

You can't publish your HTML documents from your personal desktop computer. To make your documents available over the web, you will need to move them onto a suitable web server. All students, faculty, and staff at Aurora University have access to AU's web server for this purpose. Staff in the Information Technology Services office can upload your web documents onto the server so that they become accessible over the web, or alternatively can show you how to store your HTML files in your own personal storage area. For details on AU's various forms of web support, consult the Web Publishing Policy on the web at http://www.aurora.edu/is/webpolicy.htm, or contact the ITS offices.

A Basic HTML Document

HTML documents are highly structured. Many of the elements are optional, but there are several structural features which, according to the HTML standard, must be present. Here is an example of a basic HTML document in its entirety:

<html>
<head>
<title>A Basic HTML Document</title>
</head>
<body>
This is a really simple web document.
</body>
</html>

This is perfectly legal HTML document, which would be displayed in a web browser as follows (less the box):

This is a really simple web document.

We'll analyze this program line-by-line in a moment, but first, a few notes on HTML tags:

Here is a line-by-line analysis of the syntax from the example page above.

Lines 1 & 8. The entire document is enclosed in the <html>…</html> tag pair. This identifies the file to the browser as an HTML-encoded document.

Lines 2-4. Within the HTML document, there are two main sections. The first section, enclosed in the <head>…</head> tag set, is the header section and contains information that is used by the browser but is not actually displayed as part of the document.

Line 3. The one essential component of the header section is the title, tagged as <title>…</title>. The term "title" is somewhat misleading, because the text between these tags is not displayed as the title in the document, but appears in the top margin of the window that is used to display the document, and is also used in other ways by the browser. This title should be concise and descriptive.

Lines 5-7. The second required section is enclosed in the tags <body>…</body>. This section contains the text and images that are actually displayed by the browser.

 

A Simple HTML Toolkit

A large number of HTML tags are available, some quite complex, and more are being added as the HTML standard is further defined. Also, many simple tags can take additional attributes, optional parameters that change the way they work. These are usually included inside the opening tag and take the form of a name and a value connected by an equals sign.  A surprisingly large percentage of basic documents, however, can be created with just a small set of basic tags. Here is a listing of some of these tags and what they do:

Example Appearance Comments
<b>Bold</b> Bold Causes text to display in boldface
<i>Italics</i> Italics Causes text to display in italics
<b><i>Bold Italics</i></b> Bold Italics It is possible to nest tags within other tags. It is important to make sure that the tags are symmetrical and no elements are missing.
Line 1<br>Line 2 Line 1
Line 2
An important difference between HTML and regular text editing is that Browsers ignore carriage returns. To force a new line you must use the line break tag. Each instance of the
tag creates a new line. There is no closing tag.
Paragraph 1<p>Paragraph 2 Paragraph 1

Paragraph 2

Similar to the line break is the paragraph break. The difference is that a blank line is inserted between the text elements separated by this tag. Also, unlike the line break, the browser will only execute one instance of the paragraph tag, no matter how many in a row there are. The <P> tag can have a closing tag, but it is not required.
<center>Centered text</center>
Centered text
As the name implies, this tag centers the text it encloses in the space available. In a browser, centered text will always be centered, whatever the size of the user's display window.
<h3>Medium Heading</h3>
<h1>Large Heading</h1>

Medium Heading

Large Heading

The heading tag is useful for creating bold-face titles and section headings. There are six available sizes, <H1> through <H6> (the smaller the number, the larger the text). Useful when combined with the <CENTER> tag.
<hr>
The horizontal rule is a graphical bar useful in creating section dividers. You can include graphical images as various decorative rules, but the <HR> tag is faster, and the width of the the rule adjusts to the window. You can insert an optional parameter inside the tag that reduces the width of the rule and centers it. For example <HR WIDTH="75%"> creates a centered rule that covers only 3/4 of the available width. No closing tag is required.
Unordered List <ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ul>
Unordered List
  • First item
  • Second item
  • Third item
This is a more complex tag that creates an "unordered" (i.e. not numbered, or "bullet") list. Each list element begins with the tag <li>, and each element automatically begins on a new line without the need of inserting the <br> tag. Use the <p> tag between list items to create a blank line between list entries.
Ordered List
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</OL>
Ordered List
  1. First item
  2. Second item
  3. Third item
This is the list structure for creating an "ordered" (i.e. numbered) list. If you insert a new item in the middle of the list, the rest of the list is automatically renumbered. Note that you can nest list structures within other list structures, to create an outline effect.
Regular text.
<blockquote>
Indented text.
</blockquote>
Regular text
Indented text
HTML browsers ignore the ordinary tab characters, just as they ignore ordinary carriage returns. You can, however, force text to be indented by the blockquote tag. The text stays indented until the tag is switched off. Blockquote tags pairs can be nested

Setting up Hyperlinks

As any regular user of the web can tell you, one of the most powerful features of the web is its support for "hyperlinks" that point from one document to another. The two documents may be sitting in the same directory on the same computer, or they may be on computers ten thousand miles away from each other -- as long as the link contains the correct address for the target file, the browser can locate it and deliver it to you when you click on the reference. You do not have to "own" the document that you link to. But because you don't control the remote document, its owner may rename, relocate, or delete that document at any time without warning, rendering your link useless. The tag used to create such a link is a bit more complex, but well worth learning because hyperlinking is the heart and soul of the web. Here, for example, is a link that retrieves the Aurora University home page:

<a href="http://www.aurora.edu/">Aurora University Home Page</a>

Note that the tag has three components:

  1. The entire link is enclosed in the "anchor" tag pair <a>…</a>.
  2. The opening anchor tag contains a parameter naming this particular anchor type as a "hypertext reference," or href, and assigns it (using an equals sign) the URL for the target page, in this case "http://www.aurora.edu/". The quotation marks are required.
  3. In between the opening and closing tag is the link text, in this case "Aurora University Home Page," which the browser will ordinarily display in blue underlined characters. When the user clicks on this highlighted text with the mouse, the browser extracts the URL and uses it to locate, retrieve, and display the referenced page.

Learning More about HTML

This document is not designed to be any more than a basic introduction to the tags that you will normally use in developing text-oriented pages. As you become more confident in your abilities, you may wish to learn to execute more sophisticated HTML functions. Here is a brief summary of areas for further study.

One of the best ways to learn to use tags is to look at what others have done. When you are browsing the web and see a page you like, use the View Page Source option to display the actual tags used to create the document. For more detailed study, a large number of books about HTML, ranging from basic introductions to technical manuals for experienced programmers, are currently available. An excellent sources for information on the creation of web documents is actually the web itself. Here are the URLs of some useful tutorials and HTML guides:

The Beginners Guide to HTML (http://www.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimer.html). A useful and readable tutorial, produced at NCSA, birthplace of Mosaic, the first graphical web browser.

The Bare Bones Guide to HTML (http://werbach.com/barebones/). Kevin Werbach's introduction to web publishing, including a quick reference to all the HTML tags and the syntax for using them.

Introduction to HTML (http://www.cwru.edu/help/introHTML/toc.html). A summary of terms, concepts, and information on using HTML tags. Produced at Case Western Reserve University.

Web Monkey (http://hotwired.lycos.com/webmonkey). A commercial site containing a wide variety of aids for both beginning and experienced HTML editors.

Web Style Guide (http://www.webstyleguide.com). An excellent guide for creating good looking and effective web pages.


ITS Home · AU Home