Articles: Getting Started with
HTML
A browser
can display information on the Internet
as well as that contained locally on your
hard drive. For the following lessons,
you will be creating HTML documents on
your desktop and then viewing them. To
help organize, you should create a folder
on your desktop and name it lessons.
TAGS
Now its time
to create an HTML document! First, you
will need to open up your text editor
and type on the first line:
<HTML>
What youve
just typed is called a tag.
Tags are basically commands that tell
the browser what to do and how to look.
Each HTML tag MUST begin with <
and end with >. These symbols
are what let the browser know that it
is reading an HTML command and not text.
For convention you might want to write
tags in all lower-case letters, but browsers
will still understand tags even if they
are in all upper-case or a mixture. (In
this guide we present HTML tags in all
upper case to make them easier to spot,
but again, you can type in either upper
or lower-case letters. It is good, however,
to be consistent.)
The <HTML>
tag simply lets the browser know that
the following information is in HTML format.
You must have this tag in all your HTML
documents, as the first tag, in order
to properly display your content.
Now type the
following:
<BODY BGCOLOR=BLUE
TEXT=BLACK>
The <BODY>
tag is perhaps the next most frequent
command you will use. It and its descriptors,
such as BGCOLOR and TEXT, set the color
and look of your browser.
BGCOLOR sets the background color to whatever
it equals. Therefore <BODY BGCOLOR=BLUE>
will make your HTML document have a blue
background. <BODY TEXT=BLACK>
will make all your text, unless specified
otherwise, appear black. The tag descriptors
can and should be placed within the same
<BODY> tag. There are other descriptors
for the <BODY> tag, which will be
presented in the following lessons.
You should
note that in the first few examples we
will specify our background and text color
by simply making the tag descriptor equal
a colors name. You can, however,
use a six alpha-numeric code to come up
with more colors and variations. This
is described later on in lessons. For
now, however, you can experiment with
colors by simply using the common names
such as red, green, yellow, black, gray,
blue, white, etc.
Now type:
Hello. This
is my first HTML document.
Notice that
we didnt use any tags to write our
sentence. Any text not contained in <
> will be written on the browsers screen
and be made viewable. Its also important
to note that when typing in your text
editor you will have to format all the
text yourself. In other words, line spaces,
font type, text color, etc. must all be
specified. Additional spaces or line returns
are simply not recognized by the browser.
The tags used for line spaces and returns
are described in the following lesson.
Now type:
</HTML>
This tag tells
the browser that you are done writing
your HTML document. Anytime you see a
/ in a tag, it is telling
the browser to end the proceeding command.
This will become clearer later on when
we have to turn off certain
commands in order to display text and
links correctly.
Now, its time
to save your first HTML document and view
it in your browser. To do so, save the
document to the lessons folder
located on your desktop of your computer.
In the save window you will
likely have to navigate to the folder.
Save the document as as .txt file, but
name it lesson2.html. On HTML documents
you must have .htm or .html as the suffix.
Do will have to type .html or .htm on
your document name, otherwise the suffix
will automatically end .txt.
Once
youve saved the HTML document, open
your browser and from the file menu option
select open file. Navigate to your lessons
folder and open the lesson1.html. You
should now see a the text you typed with
a blue background. If you cant see
it, make sure you have all your tags typed
correctly and have saved it as a .html.
Next>>
HTML Tags
|