This section describes the rudimentary HTML tags.
Creating HTML documents is a lot like using the old word processing program WordStar. (Remember WordStar?) For example, to print a word in boldface type using WordStar, the user would first select text from the screen. Then the user would enter a code like "^b." This code would be inserted before and after the selected text. When the document was printed, WordStar would interpret the "^b" and print boldface letters until another "^b" was encountered.
HTML works in a similar fashion. The author goes through his or her document surrounding text with special codes denoting content. As HTML editing software matures, there is less and less of a need to know HTML tags, but until this comes to complete fruition, it is a good idea to have a knowledge of the HTML codes themselves.
If you want to insert the less than or greater than symbols into your text, then you need to insert an "entity" representing this symbols instead. The entity for less than (<) is < and the entity for greater than (>) is >. Consequently, when you insert "<" or ">" into your text, then the less than or greater than symbols will be displayed.
Similarly, since the ampersand (&) is used as an "escape" character for entities, there need to be a way of "escaping the escape." Thus, the ampersand can be displayed using the entity "&". The double-quote is another symbol that is used in HTML tags and needs to be escaped as well. Consequently, if you want to insert quote marks into your HTML documents, then you should use the entity """ instead. (Fortunately for the people who create HTML by hand, many WWW browser do not get confused when quote marks appear in the HTML code.)
There are a whole slew of additional entities you can use in your HTML documents. Many of these entities represent non-English characters. You are encouraged to read Appendix A for a list.
<TITLE>My first HTML document</TITLE>
All tags are case-insenstive. Consequently, each of the tags here (
</HTML>), as well as any other tag, can be written in lowercase letters or even a combination of upper- and lower-case letters. Furthermore, all carriage return sequences are ignored by WWW browsers (with one exception described later). Thus, the text above could have been written like this and will be rendered exactly the same way:
<html><head><title>My First HTML Document</title></head><body>Hello, World!</body></html>
The most important thing about this example is the tags themselves. They are used to outline the basic HTML document. The
</HTML> tags define the document as an HTML document; the
</HEAD> tags denote the leading matter of a document; the
</TITLE> tags specify the document's title; and the
</BODY> tags specify the location of your content. Notice how the second tag of each tag pair is identical to the first tag except the second tag includes a backward slash ("/"); the backward slash denotes the completion of a logical formatting option.
The paragraph tag inserts a blank line between the text proceeding the tag and after the tag. Do not expect to insert multiple paragraph marks into our documents and expect to get multiple blank lines. That is the purpose of the next tag.
<BR>) is one way to force a carriage-return and line feed effect into your documents. It is very useful when you want to make sure a sequence of lines always begin at the left-hand side of page and you don't want blank lines between each item in the sequence. This was the technique used in the very first example above. The HTML looks like this:
If you want to create a sequence of blank lines in your documents, then insert a sequence of line breaks as in
<TITLE>My first HTML document</TITLE><BR>
<H1></H1>) is meant to be used to denote the broadest heading. Whereas the sixth heading (
<H6></H6>) is used to denote the most specific.
Like most of the HTML tags, these tags are intended to surround lines of text, usually a single line. Here are six lines using the headings tags:
Here is how those codes get rendered:
<HR>) are another way of separating sections of your documents from other sections. This tag does not surround any text; this tag is used just like the paragraph (
<P>) and line break (
<BR>) tags. The following HTML code illustrates this point:
Here is what this sort of HTML creates:
Judicious use of the
<HR> tag makes your HTML documents easier to read.
<PRE>...</PRE>,the preformatted tag.
By surrounding text with the preformatted tag in your HTML, the carriage returns and spaces within the text will be retained. Unfortunately (or fortunately), the text will most likely be displayed in some sort of mono-spaced font.
For example, using the preformatting tag you can create a simple table. The desired output looks like this:
1 2 3 --------- A | * * B | * C | *The corresponding HTML looks like this:
Remember, when you use the<PRE> 1 2 3 --------- A | * * B | * C | *</PRE>
<PRE>tag, your WWW browser retains the spaces and line breaks of the formatted text.
When inserted into your HTML, it looks like this:
<!-- This is a comment. It is include text in your HTML without it being rendered. -->
Pretty exciting, huh?
This page was first published on September 26, 1995. Feel free to send comments.