You can make your text either larger or smaller by inserting a <FONT> tag, like this:
<FONT SIZE=-1>This is a test.</FONT>
<FONT SIZE=+1>This is a test.</FONT>
<FONT SIZE=+2>This is a test.</FONT>
<FONT SIZE=+3>This is a test.</FONT>
<FONT SIZE=+4>This is a test.</FONT>
<FONT SIZE=+5>This is a test.</FONT>
<FONT SIZE=+6>This is a test.</FONT>
<FONT SIZE=+7>This is a test.</FONT>
The text will be displayed like this:
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
Many browsers will also support setting of the base font size at any
point in the document by insertion of the <BASEFONT SIZE=> tag.
The default font size is 3, and the allowable size range is 1-7. Subsequent
<FONT size=> tags then operate on the new base font size. For example,
insertion of the tag <BASEFONT SIZE=2>
The color of individual portions of text can be changed in browsers that support the Netscape 2.0 enhancements to this tag. For instance:
<FONT SIZE=+6 color=red>This is a test.</FONT><FONT color=cyan>This is a test.</FONT>
will give:
This is a test.This is a test.
Before I describe how to place tables in your document, I should say a few words about them. They have the obvious use of placing tabulated information in your HTML document. For example, the index for this document is a table containing a couple of unordered lists. But tables have a second (perhaps more important) use. They are the primary HTML tool for controlling page layout. This is done by overlaying a table (lines invisible) on the page, then placing text and graphics in various cells of the table as a means of locating them in specific areas of the page. This section will cover only table construction. See the "Tips" index for a discussion of using tables to control page layout.
<TABLE> <TR> <TD>apples </TD> <TD>oranges </TD> <TD>bananas </TD> </TR> <TR> <TD>pineapples </TD> <TD>lemons </TD> <TD>tangerines </TD> </TR> </TABLE>The table itself will display like this:
apples | oranges | bananas |
pineapples | lemons | tangerines |
NO LINES! Right. Lines have to be added by specifying a border thickness (in pixels) after the opening TABLE tag (<TABLE BORDER=4>). Now our table looks like this:
apples | oranges | bananas |
pineapples | lemons | tangerines |
Let's go on and see what else we can control about our table. We can center it by enclosing the entire code for the table in CENTER tags, like this:
apples | oranges | bananas |
pineapples | lemons | tangerines |
apples | oranges | bananas |
pineapples | lemons | tangerines |
Hmmm. Now the columns are different widths. We can specify the width of each column by adding a similar WIDTH= statement to one TABLE DATA tag in each column. I guess it is time to show the whole table code again so that nobody gets lost.
<TABLE BORDER=4 WIDTH=60%> <TR> <TD WIDTH=33%>apples </TD> <TD WIDTH=33%>oranges </TD> <TD WIDTH=33%>bananas </TD> </TR> <TR> <TD>pineapples </TD> <TD>lemons </TD> <TD>tangerines </TD> </TR> </TABLE>Notice that the percentage here is in terms of the table width, not the page width (one advantage of specifying width in pixels). This gives:
apples | oranges | bananas |
pineapples | lemons | tangerines |
We should also center the cell contents in the cell. This can be done by adding ALIGN=CENTER (or RIGHT, or LEFT) to each opening TABLE ROW tag (<TR ALIGN=CENTER>). The ALIGN spec can also be added to individual cells, and will override the row alignment specification. Isn't this fun? We must be nearly done - NOT! There are lots of things to tamper with yet. In any case, our table now looks like this:
apples | oranges | bananas |
pineapples | lemons | tangerines |
There is also a VALIGN=CENTER (or TOP, or BOTTOM) spec that is used in the same way as ALIGN to control vertical placement of the cell contents.
Individual cells within the table can be joined to form larger cells by adding COLSPAN= or ROWSPAN= to the TABLE DATA tags. If the first data cell in the first row of our table is written <TD WIDTH=33% ROWSPAN=2>apples </TD>, and the first cell is left out of the row below to make room, the table looks like this:
apples | oranges | bananas |
lemons | tangerines |
If we had added COLSPAN=2 instead of ROWSPAN=2, and left out the cell to the right rather than the cell below, the table would have looked like this:
apples | bananas | |
pineapples | lemons | tangerines |
The code now looks like this:
<TABLE BORDER=4 WIDTH=60%> <TR ALIGN=CENTER> <TD WIDTH=33% COLSPAN=2>apples </TD> <TD WIDTH=33%>oranges </TD> <TD WIDTH=33%>bananas </TD> </TR> <TR ALIGN=CENTER> <TD>lemons </TD> <TD>tangerines </TD> </TR> </TABLE>While we are on the subject of cell size, I should mention that by default, cell contents will wrap in the cell, with a corresponding increase in cell size as necessary. If we put more text in one of our cells, this happens:
apples, golden delicious or cortland | oranges | bananas |
pineapples | lemons | tangerines |
This can be prevented by adding the spec NOWRAP to the TABLE DATA tags.The cell width will increase to fit the contents, overriding the cell width settings you have made.
We are getting close to the end now. You can caption a table by adding a pair of <CAPTION> </CAPTION> tags within the TABLE tags, but not within a row or cell. The caption will be centered on the table, and will be placed at the top by default. It can be placed at the bottom by adding ALIGN=BOTTOM to the opening CAPTION tag.
apples | oranges | bananas |
pineapples | lemons | tangerines |
I should also mention that there are TABLE HEADER cells (<TH> </TH>). They are identical with TABLE DATA cells in every respect except that their contents are displayed in bold font. No biggie.
You will notice that I have taken great care in this example to format the code neatly. I advise that you make a habit of this, so that when you go back and look at the code for a table, it makes some sense. Please do not use VIEW, SOURCE to see my table code. Do as I say, not as I do.
This will be a fairly long section, so you may want to get a cup of coffee or a beer or something before you start reading.
Lets start out by taking a look at a form that uses all of the common form elements, with the code that generates each element shown in bold beneath it. I have disabled this form by putting in a bogus email address to keep my mailbox from overflowing. I suppose I could have used Bill Gates email address or something like that. Click the buttons all you want, but clicking the "send" button may result in undelivered mail being returned to you.
First of all, the form is opened with a FORM tag. For an explanation of METHOD and ACTION, see the last part of this section.
<FORM METHOD="POST" ACTION="mailto:nobody@nowhere.net">
There are two possible ACTIONs for forms, but only one that is available to the average user.
ACTION="filename" will feed the form submission to an executable file or script on the server, which will process the submision and do something with the result, usually write it back to the screen in HTML. For instance, when you do an InfoSeek search, you enter your input in a form. It is fed to a database program, which conducts the search of the database and writes the results back to your screen. This is very cool, but most servers (including GeoCities) will not allow you to use it, for security reasons. Many servers have some "canned" scripts that you can use. When this is the case, the server will provide you with specific instructions for using the script.
The second option is ACTION="mailto:email address". This one is available to everybody, and is the one you will most likely use. In this case, the form submission is emailed to the indicated address. So what is a "form submission"? I have filled in the sample form above, and mailed the results to myself. Here's what it looks like:
name=Harry+Ellery&comments=This+was+entered+in+the+TEXT+AREA.%0D%0A &opsys=win3.1&wordprocessor=on&database=on&age=25-50&contact=Email &contact=Fax
Hello? What's that? Not exactly straightforward, is it? Change + to space, replace each & with a carriage return, and interpret each two-character string following a % to it's ASCII equivalent, and you have it! If you look at it for a while, you will be able to interpret it. This may not be as cool as you thought it would be, but that's forms, There are some other tags, such as password fields, that I won't go into because this is a basic primer, and they aren't really useful with the mailto: action. That's forms.
If you are looking for the ultimate in slowness and obscurity for your page, look no further. Imagemaps are for you! Where you could have just an instant-loading and easily understood list of choices, you can have a huge graphic which will take forever to load (if it loads at all) and is hard to understand. The definitive geek tool! Now that you know what I think of imagemaps, I will tell you what they are and how to do them.
An imagemap is a graphic image in which different areas of the image have been hotlinked to different parts of your page or to other locations on the web. Click here to see one. The user can go to those links by clicking on the proper areas of the picture. If you haven't mastered graphic images and ftp'ing files, You should cover those sections before you tackle imagemaps.
It isn't very difficult to put imagemaps on your page. These are the steps to follow:
<A HREF="/cgi-bin/imagemap/Athens/2090/mapbuttn.map"><IMG SRC="mapbuttn.gif" ISMAP></A>
Put your city and number in place of mine, and the name of your image file in place of "mapbuttn.gif". Your imagemap should now be in working order.