<META NAME="keywords" CONTENT="Keywords and phrases, separated by commas, especially those that don't appear in the displayed text of the page, for example because they describe information that is presented graphically.">
<META NAME="description" CONTENT="A short description of the information presented by or linked from the page.">
The CONTENT attribute for the keywords or description will typically be included in the text that is indexed by the search engines. Some search engines will display the description content, or at least part of it, when a hit is found on that page.
The BORDER attribute specifies the width of the border. By default the border around an image is zero, unless the image is inside an HREF anchor tag, and is therefore clickable. Depending on the visual context, you may well want to specify BORDER=0 to suppress the border around a clickable image, or to specify BORDER=1 to put a hairline border around a non-clickable image.
The HEIGHT and WIDTH attributes are especially important. As we mentioned in the first seminar, using HEIGHT and WIDTH in your IMG tags tells the web browser how much space to allocate to a given image on the screen, thereby decreasing load time significantly. It speeds things up because the browser does not have to calculate the size of your image based on the data in the image file itself, and therefore the browser does not have to wait for the image file to be received in order to continue laying out the rest of the text on the page. This is especially important for people using dialup internet access, because most of the text of the web page will be available long before the images are.
You can also stretch and shrink images using these attributes, although the results are often ugly and it always takes extra time to display the image, because the browser system has to compute the color of each pixel, instead of reading it directly out of the graphic file. The examples below are all the same file, but have different HEIGHT and WIDTH attribute values.
<IMG HEIGHT=118 WIDTH=112 SRC="../gifs/calvinyuck.gif" ALT="Calvin">
The other graphics use smaller values of the WIDTH and HEIGHT attributes.
You may well be able to experiment more rapidly with different possible sizes for an image by using the WIDTH and HEIGHT attributes, but once you have decided on the best size, you should prepare a new version of the image file that is actually that size. Displaying the image at a small size on the screen does not save loading time if the data file is still the same old monster. Good graphic software will be able to do a smoother job of scaling the image than most browsers do when they are presented with an image file that does not match the specified HEIGHT and WIDTH.
The BODY tag also supports the attributes BGCOLOR, TEXT, LINK, ALINK, and VLINK. Each of these take an RGB color value in hexadecimal notation:
<BODY BACKGROUND="../gifs/my_background.gif">or
<BODY BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#65AD99">
If you want to do something different from the default, you will probably not encounter any nasty surprises by specifying a background color that is paler than the default gray, especially if you go all the way to white, as we have done with this page. A white background is a good idea for a presentation, since it provides the best available contrast with the black text.
Please do not specify any of the TEXT or LINK colors: your reader has been building up an intuitive feel for the meaning of various colors, based on the default behaviour of his or her browser. When you try to override that, you are discarding the reader's intuition. This is so far from being "user-friendly" that it deserves to be called not merely "user-hostile," but perhaps even "user-vindictive."
The trick is to use the ampersand character ("&"), followed by a specific text string, followed by a semicolon. Of course, this means that you have to use the trick to display an ampersand character, too. For example:
Browsers are now rarely forgiving if you fail to include the terminating semicolon, so be sure to include it each time. Obviously, you must include the terminal semicolon if you want to display a special character followed by a semicolon; for example:
The specific text string may be of the type shown above, with letters (that are case-sensitive), or it may be of the form &#nnn;. The latter results in the browser displaying whatever character is coded on that platform by the numerical value between the pound sign and the semicolon. It is essentially never a good idea to use the &#nnn; codes for specific characters, because you cannot be sure what browser and platform your audience will use to examine the page: either the numerical value (the "nnn" part) is one that calls up the same standard character on Macintosh and on Windows, in which case you should simply have typed that character, or the numerical value specifies different characters on Macintosh and on Windows computers, so if you test it on one, users of the other will see something entirely different!
This is a blockquote section. It is separated from the text above by a <P> tag and the </BLOCKQUOTE> tag is immediately followed by the <HR> tag.
Once you are adept at using tables (discussed next) and lists, you can even combine them! With some perseverance you can recreate just about anything using HTML. It is pretty ugly, and can take a lot of time and effort, so I would recommend starting simple. This page will be available so you can always come back to it when you are ready for more advanced formatting.
There are two situations where you will be tempted to use tables:
Care is especially needed for the first situation, because of the substantial risk that the resulting page will end up being very difficult to use for people whose browsing environment differs from your testing environment.
first second third 1 2 3 4 5 6
Is produced by the following HTML code:
<PRE>
first second third 1 2 3 4 5 6 </PRE>
This is easier to use if you can tell your word processor to display that section of the code in a fixed-pitch font, such as Courier, so that you can get the columns to line up on the first try. Do not use tabs, only space characters, to align the columns.
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
Pretty exciting isn't it? You can't get a good feeling about what is going on because there isn't much there. If I put a border on the table though, you can see what is happening:
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
Whoa, now we are getting somewhere. I added a BORDER attribute to the TABLE tag: <TABLE BORDER>. You can size the border by adding a number to the border attribute, like so: <TABLE BORDER=10>, which produces the following fat, beveled border table:
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
You can also tinker with the spacing of the cells, or how far apart from each other they are.
<TABLE BORDER CELLSPACING=0>
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
<TABLE BORDER CELLSPACING=10>
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
<TABLE BORDER CELLSPACING=20>
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
Are we having fun yet? Let's play with the padding inside the cells now:
<TABLE BORDER CELLPADDING=0>
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
<TABLE BORDER CELLPADDING=10>
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
<TABLE BORDER CELLPADDING=20>
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
Now we can get really crazy and do all three:
<TABLE BORDER=10 CELLPADDING=10 CELLSPACING=10>
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
You want attributes? How about adding a WIDTH attribute to the table like so:
<TABLE BORDER WIDTH="80%" CELLPADDING=10 CELLSPACING=0>
| Data element One | Data element Two | Data element Three |
| Data element Four | Data element Five | Data element Six |
Do be careful with WIDTH attributes on table or cell tags. Your page will be more vulnerable to variations in browser window size.
Playing with borders can be fun, but they really aren't what tables are about. Tables are really great for formatting columns of text. Lists of numbers and images can also be put in tables. The example below illustrates the various features that you can control, it is not intended to be a model of clarity!
Daily revenue in Millions |
||
| Oklahoma | Talahasse | Ohio University |
| 100 | 300 | .000005 |
| 100 | 300 | .000005 |
| 100 | 300 | .000005 |
The source for the above table is given next. You will notice several new attributes, I will explain them all in class. Most of them are pretty self-explanatory, or are similar to ones you already know. As you can see, tables are pretty ugly and take a lot of time and effort to use. But the effort does pay off, and the final result is usually well worth it.
<CENTER>
<TABLE WIDTH="50%">
<TR VALIGN=top>
<TD ALIGN="CENTER" COLSPAN=3><BR><H3>Daily revenue in Millions</H3></TD>
</TR>
<TR VALIGN=top>
<TH WIDTH="30%">Oklahoma</TH>
<TH WIDTH="30% ">Talahasse</TH>
<TH WIDTH="30%">Ohio University</TH>
</TR>
<TR VALIGN=top>
<TD ALIGN="RIGHT">100</TD>
<TD ALIGN="RIGHT">300</TD>
<TD ALIGN="RIGHT">.000005</TD>
</TR>
<TR VALIGN=top>
<TD ALIGN="CENTER">100</TD>
<TD ALIGN="CENTER ">300</TD>
<TD ALIGN="CENTER">.000005</TD>
</TR>
<TR VALIGN=top>
<TD ALIGN="LEFT">100</TD>
<TD ALIGN="LEFT">300</TD>
<TD ALIGN="LEFT ">.000005</TD>
</TR>
</TABLE>
< /CENTER>
It is kind of tough to notice what is happening in the above table, that is why I recommend using the BORDER attribute when designing them. The same table above is presented next with the BORDER attribute.
Daily revenue in Millions |
||
| Oklahoma | Talahasse | Ohio University |
| 100 | 300 | .000005 |
| 100 | 300 | .000005 |
| 100 | 300 | .000005 |
A real-world example of a table can be seen in the information returned by the Ohio University Registrar's Course Offerings List.
Dick Piccard revised this file (http://www.ohio.edu/pagemasters/class/html2/markup.html) on June 5, 2009.
Please E-mail any comments or suggestions to acatec@www.ohiou.edu.