The B. Davis Schwartz Memorial Library

GETTING STARTED

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:

<HTML>

<HEAD>
</HEAD>

<BODY>
</BODY>

</HTML>

It doesn't matter how many lines you space between each tag. It will display the same even if you type it like this:

<HTML><HEAD></HEAD><BODY></BODY></HTML>

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:

<HEAD>
<TITLE>
Getting Started
</TITLE>
</HEAD>

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.

bgcolor="#RRGGBB"
Determines the color of the background.
text="#RRGGBB"
Determines the color of the text.
link="#RRGGBB"
Determines the color of the links.
alink="#RRGGBB"
Determines the color the links will flash when you click on them.
vlink="#RRGGBB"
Determines the color the links will become after you visit them.
RRGGBB stands for the hexadecimal color.

If we want our page to have a white background with dark green text and red links that flash yellow and then turn dark red after they've been visited, the <BODY> tag would look like this:

<BODY bgcolor="#ffffff" text="#006600" link="#ff0000" alink="#ffff00"
      vlink="#660000">

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:

<BODY background="skyback.gif" bgcolor="#fafafa" text="#000077"
     link="#000000" vlink="#000000" alink="#0000ff">

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.



Previous Section
Table of Contents
Next Section



Return to the Library Home Page

HTML by Robert Delaney
rdelaney@aurora.liunet.edu



     Return to Long Island University Home Page                        
                Return to  C.W. Post Campus Home Page