Back to Home Page Back to Main HTML Page


SECTION CODES


This is a tough section, since I can't really demonstrate the results of the tags I show you. Here's some of the theory, though.

First of all, just as a matter of convention, the first tag in your HTML document should always be the <HTML> tag. Make this your habit. It alerts browsers that your document is written in HTML. Likewise, the very last tag in your document should always be the </HTML> tag - it is a cue to your browser (and to you or anyone else who reads the code) that your page is done.

HTML pages are always broken up into two sections, called the head and the body. The head contains information about the page that other programs might need to know, while the body contains all of the stuff that your readers will see.

You surround the head section with the <HEAD> and </HEAD> tags. It can contain two basic things: the title and "meta" tags.

Here is the complete HEAD section for the page you are now reading:
<HEAD>
<TITLE>Steve's HTML Primer - &lt;SECTION CODES&gt;</TITLE>
<META name="description" content="This page explains the head, body, and HTML tags.">
<META name="keywords" content="HTML, section codes, Steve Anisman">
</HEAD>



The BODY section of the page contains all of the information that you are now reading. The body section is started with a <BODY> tag, and is ended with a </BODY> tag. The opening tag can (and should) contain some additional information.

For example, here is the complete BODY tag for the page you are now reading:

<BODY
BACKGROUND="bckgrnds/marblbak.gif"
BGCOLOR=000000
LINK="#0000FF"
ALINK="FF0000"
VLINK="000066">

Let's go through this line by line.

Note that the BODY tag was shown over 6 lines - this was for ease of reading and modifying. Your browser didn't even notice that it was spread over six lines - it read the whole thing as if it was written like this:
<BODY BACKGROUND="bckgrnds/marblbak.gif" BGCOLOR=000000 LINK="#0000FF" ALINK="FF0000" VLINK="000066">
In fact, this is a perfectly fine way to write it.

At this point, you know what you need to know about the HEAD and BODY sections. Let's look at one final example to see how it all fits together:

<HTML>

<HEAD>
<TITLE>
Steve's Sample Web Page</TITLE>
<META name="description" content="This is a bogus page that demonstrates section codes in HTML.">
<META name="keywords" content="HTML, section codes, Steve Anisman">
</HEAD>

<BODY
BACKGROUND="bckgrnds/marblbak.gif"
BGCOLOR="#000000"
LINK="#0000FF"
ALINK="#FF0000"
VLINK="#000066">

<DIV ALIGN=CENTER><FONT SIZE=7 COLOR="red">
Bogus Page</FONT></DIV>

<BR><BR>


This is bogus text.<BR><BR>

Click <A HREF="hthedbod.htm"> here</a> to return.<BR><BR>
</BODY>

</HTML>





Back to Top of Page Back to Main HTML Page Back to Home Page

Last Updated: