What Is HTML?: What Is HTML? What Are Tags? Explanation of Document Structure Explanation of Document Structure Tags
What Is HTML?: What Is HTML? What Are Tags? Explanation of Document Structure Explanation of Document Structure Tags
There is
no need to learn the entire HTML programming language as this tutorial is designed to
provide a general understanding of the codes. In this lesson the following basic definitions
and relevant tags are discussed:
What is HTML?
What are Tags?
Explanation of Document Structure
Explanation of Document Structure Tags
What is HTML?
HTML (Hyper Text Markup Language) is the language used to write Web pages which
consists of codes (tags) embedded in the text of a document.
Tags are codes in an HTML document which the browser reads and then interprets for
subsequent display to a reader. Tags are not visible when an HTML document is viewed in a
browser, but their effects are. Tags begin with the opening symbol "<" and end with the
closing symbol ">"; and usually come in pairs, one that begins an action and one that ends
it.
I want to
<B> emphasize </B> this!
I want to emphasize this!
* Do not worry about memorizing all the tags described in these lessons. Any tags that are
required are listed in the accompanying HTML Reference Guide which can be printed for
reference purposes.
Each HTML document has a minimum number of tags. Here is the very least HTML code that
can be called a "page":
<HTML>
<HEAD>
<TITLE>This is my page Title!</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
EXAMPLE:
<BODY BACKGROUND= "picturename.gif">
</BODY>
EXAMPLE:
<BODY BGCOLOR="#FFFFFF">
This page has a white background.
</BODY>
OR
EXAMPLE:
<BODY BGCOLOR="WHITE">
This page has a white background.
</BODY>
EXAMPLE:
<BODY LINK="#0C6249">
This page has blue links
</BODY>
EXAMPLE:
<BODY VLINK="#800080">
This page has purple links after being visited
</BODY>
EXAMPLE:
<BODY ALINK="#FFB50C">
This page has yellow active links
</BODY>
EXAMPLE:
<BODY TEXT="#00006A">
This page has blue text
</BODY>
<BODY BACKGROUND="spiral_ruled.gif"
BGCOLOR="#FFFFFF" TEXT="#00006A"
LINK="#005A5A" VLINK="800080"
ALINK="#FFB50C">
This lesson introduces a number of basic tags that allow an HTML page to be formatted -
much in the same way that word processors format documents. The following topics are
covered:
Character Formatting
Paragraphs
Paragraph Alignment
Forced Line Breaks
Spaces
Horizontal Rules
Character Formatting:
The Bold <B></B> element specifies that the enclosed text should be displayed in boldface.
The Underlined <U></U> element specifies that the enclosed text should be displayed
underlined.
The Italic <I></I> element specifies that the enclosed text should be italicized.
Below are these HTML tags beside samples of their respective browser displays:
Paragraphs
In HTML you indicate paragraphs with the <P> and </P> elements. Without these elements
the document becomes one long paragraph. Likewise, browsers ignore any indentations or
blank lines in the HTML code.
Thus the examples below, although coded differently, are all displayed the same way:
NOTE: The </P> closing tag may be omitted. This is because browsers understand that
when they encounter a <P> tag, it means that the previous paragraph has ended.
To preserve readability when composing HTML files, separate paragraphs with blank lines.
As mentioned above, browsers will ignore blank spaces inserted into source code.
Paragraph Alignment
Paragraph alignment can be manipulated by including either the RIGHT, LEFT, or CENTER
(note the Americanized spelling) attributes within the <P> tag as shown below:
The line break tag <BR> can be used to control how browsers render text. When an HTML
document is viewed the text normally does a word-wrap at the end of a line. If a text break
is desired before the end of a line, use the <BR> tag to force a line break without any extra
space between lines. This element has no closing tag.
Using the <P> tag instead of the <BR> tag for short lines of text, such as the above
example, would have resulted in unwanted additional white space.
Horizontal Rules
The horizontal rule <HR> tag produces a horizontal line the width of the browser window.
Horizontal rules are useful for separating major sections of a document. The length of a rule
can be varied by using the "WIDTH=" and "SIZE=" attributes.
There are two other attributes that can be used with the <HR> tag. They are:
Lists
Fonts
Lists
Unordered Lists:
Browser
HTML Code Display
<UL> red
<LI> red
yellow
<LI> yellow blue
<LI> blue
</UL>
Ordered Lists:
Browser
HTML Code Display
<OL>
1. purple
<LI> purple
2. orange
<LI> orange 3. green
<LI> green
</OL>
Note: You can "nest" lists too (ie., subdivide
lists), but use this feature sparingly as too
many nested items can get difficult to follow.
Fonts
Font Sizes:
Font Size 1
Font Size 2
Font Size 3
Font Size 4
Font Size 5
Font Size 6
Font
Size 7
Font Typefaces:
Arial
Lucida Sans
Times New Roman
Verdana
Helvetica
Impact
Comic Sans MS
Font Colours:
Aqua - Aqua
Red - Red
Green - Green
Blue - Blue
Violet - Violet
Fuchsia - Fuchsia
Gray - Gray
Lime - Lime
Maroon - Maroon
Navy - Navy
Olive - Olive
Purple - Purple
Silver - Silver
Teal - Teal
White - White
Yellow - Yellow
Browser
HTML Code Display
<FONT
This is a
SIZE=2>This is a
size two
size two
font
font</FONT>
<FONT
FACE="Comic Sans This font is
MS">This font is Comic Sans
Comic Sans MS
MS</FONT>
<FONT
COLOR="Fuchsia"> This text
This text is Fuchsia
is Fuchsia
</FONT>
Images - An Introduction
o Image Source
o Image Size
Image Attributes
o Image Alignment
o Image Alignment with Text
o Alternate Text
Images - An Introduction
Image Source:
Image Size:
Although not absolutely required, it is good
practise to include HEIGHT and WIDTH
information within the <IMG> tag. This
speeds up the downloading process by
allowing faster-loading text to load around
areas where images will eventually appear.
HEIGHT and WIDTH values are measured in
pixels. Do not try to make the image smaller
or larger by adjusting these attributes as you
risk distorting the image by doing so.
Browser
HTML Code Display
<IMG
SRC="woman.gif"
WIDTH=32
HEIGHT=32>
Image Attributes
Image Alignment:
Browser
HTML Code Display
<IMG
SRC="woman.gif"
WIDTH=32 HEIGHT=32
ALIGN=LEFT>
<CENTER><IMG
SRC="woman.gif"
WIDTH=32
HEIGHT=32></CENTE
R>
<IMG
SRC="woman.gif"
WIDTH=32 HEIGHT=32
ALIGN=RIGHT>
Image Alignment with Text:
<IMG
SRC="hand.gif
" WIDTH=108
HEIGHT=79>T
his hand is This hand is very
very big! big!
Browser
HTML Code Display
<IMG
SRC="hand.gif"
WIDTH=108
HEIGHT=79
ALIGN=TOP>This This hand is
hand is big! big!
<IMG
SRC="hand.gif"
WIDTH=108
HEIGHT=79
ALIGN=CENTER> This hand is
This hand is big! big!
Browser
HTML Code Display
<IMG
SRC="hand.gif"
WIDTH=108
HEIGHT=79
ALIGN=TOP><B
R This hand is
CLEAR=ALL>Thi big!
s hand is big!