A web page begins with the <HTML> tag and ends with the
</HTML> tag. In between, there are two sections: the
<HEAD> and the <BODY>. So far, our web page looks like this:
It doesn't matter how many lines you space between each tag.
It will display the same even if you type it like this:
But doing it the first way will make it a lot easier to keep track of what you're doing.
In the <HEAD> section goes the <TITLE>, which will
be displayed in the title bar at the top of the browser:
The <BODY> section contains everything else.
The <BODY> Tag
The <BODY> tag can also be used to control the general look of your webpage if you include a few additional commands in it.
If we want our page to have a white background with dark green
and red links that flash yellow and then turn dark red after
been visited, the
<BODY> tag would look like this:
You can also use a graphic image as a background pattern. The browser will repeat (tile) a small image over and over until it fills the entire screen much the same way Windows and Macs create wallpaper. The image should be in GIF format for most of the browsers that support this feature, but some of the new versions will also accept JPEG images.
Add the command background="filename.gif" to the <BODY> tag, filename.gif is the name of the graphic that you want to be used as your background. If your graphics are in a seperate directory from your HTML files, be sure to include the path statement. Filenames are another instance where upper case vs lower case matters, so make sure you get it right.
As an example, here's what
the <BODY> tag for this page looks like:
Skyback.gif is the gray speckled background pattern. The background color will appear as a light gray until skyback.gif finishes loading. The text is dark blue. The links are black and remain black after you visit them. They flash bright blue as you click on them.
Generally, you'll want to have a light background with dark text for a dignified look or a dark background with light text for a cool look. A brightly colored background with brightly colored text tends to create a psychedelic look that can be hard to read, as can a background pattern that's too elaborate.
If you include none of this in the <BODY> tag, you will get
the default settings of a gray background, black text, and blue links
that turn purple after being visited.
HTML by Robert Delaney