|
Building a Simple HTML Document
HTML uses tags embedded in the document to instruct the browser how to display the
page. There are 90+ tags within the set of Document Type Definitions (DTD) for HTML and they:
 | Are always enclosed in < > brackets. |
 | Generally occur in pairs with an opening < > and a closing </ > tag.
Anything in between the opening and closing tags will be affected by the tag. For example:
<I>This is Italic</I>
Some tags such as <BR> (line break), <HR> (horizontal rule) and <IMG>
(image) do not require closing tags.
|
 | Can include one or more attributes. For example, in the tag
<IMG SRC="picture.gif">
"IMG" is the tag name and "SRC" is the attribute which defines the
source where the image can be found.
|
 | Are not case specific. <HTML> is the same as <html> or <Html>.
Generally it is each webmaster's choice whether or not to use upper case or lower case
within their source code. Personally, I like using CAPS because it makes the source
easier to read when proofing for errors. While HTML tags are not case specific, the
content of attributes may be. For example, <IMG SRC="picture.gif"> may not
be the same as <IMG SRC="Picture.GIF">. Attribute values which are longer
than one word should be enclosed in quotes (""). |
Here's a simple, standard HTML document which you can use as a template when making
your own web pages:
<HTML>
<HEAD>
<TITLE>Title Your Work Accurately</TITLE>
</HEAD>
<BODY>
Your text, graphics and other multimedia elements go here.
</BODY>
</HTML>
Here's how this document would appear in your browser:
Your text, graphics and other multimedia elements go here.
You will notice that tags enclosed in < > brackets do not appear when the
document is displayed in the browser. Note... You can
see them in my examples because I use special character tags instead of the brackets
for the specific purpose of presenting raw code. The four tags included in this simple
page form the backbone of all HTML documents:
 | <HTML> - Defines the document type as HTML.
(Browsers can read other text file types besides HTML) |
 | <HEAD> - Defines the introductory section of the page which includes the
title and perhaps other information. Used wisely, this tag encompasses several items that
can increase your chances of being indexed higher within search engine databases. |
 | <TITLE> - Defines the title which will be displayed at the top of the
browser window. Titles are also documented within search engine data bases, not only
as keywords, but more often as the hyperlink text back to your site. |
 | <BODY> - Defines the main section of your page which includes the text,
graphics and other multimedia elements. |
While the text and multimedia elements (graphics, audio and video) determine the
content of a page, it is the HTML tags which determine how the document will appear on the
screen. For example, suppose you typed the following HTML page:
<HTML>
<HEAD>
<TITLE>A Sample Document</TITLE>
</HEAD>
<BODY>
Your Name
Your Street Address
City, State Zip
This is a sample HTML document. It contains several line and
paragraph returns.
Thanks for dropping in!
</BODY>
</HTML>
Here's how this page would appear in your browser:
Your Name Your Street Address
City, State Zip This is a sample HTML document. It contains several line and paragraph
returns. Thanks for dropping in!
Probably not what you intended. In HTML, the browser interprets the page based only on
the HTML tags, not the spaces, tabs or returns included in the text. Two additional tags
are needed to make this document appear as you would expect:
 | <BR> - Instructs the browser to continue the document on a new line.
Several <BR> tags will produce several blank lines. <BR> does not require a
closing tag. |
 | <P> - Instructs the browser to continue the document in a new paragraph
with a blank line in between. Paragraphs can be aligned left, right or center with the
align attribute. Left is the default alignment. |
Here's the document including <BR> and <P> tags:
<HTML>
<HEAD>
<TITLE>Another Sample Document</TITLE>
</HEAD>
<BODY>
Your Name<BR>
Your Street Address<BR>
City, State Zip<BR>
<P>
This is another sample HTML document. It contains several line and paragraph breaks.
<P>
Thanks for dropping in!
</BODY>
</HTML>
Finally, here's how it would appear in your browser:
Your Name
Your Street Address
City, State Zip
This is another sample HTML document. It contains several line and paragraph breaks.
Thanks for dropping in!
This section has provided you with the basic tags that are needed to build
a web page...
<HTML>, <HEAD>, <TITLE>, <BODY>, <BR> and <P>
Return to the top
|