Rowan
(This page was last changed around May 1997, but hey, good information is timeless! At least until the XML hits the fan....)

Further down this page, you will find information on graphics, html frames and perl, but let's start with some...

BASIC HTML TIPS
Firstly, always supply image widths and heights, plus alternative text. You can do this by putting:

<img src="yourimagename" width=xxx height=xxx alt="Description here">
This speeds up display of your page, allowing the browser to lay out all the elements on the page before it has downloaded the image, and gives the image a description which can be used for many purposes - text only browsers, indexing tools, etc.

You can also add a description to Anchor tags. If you put:

<a href="yoururl" onMouseOver="window.status='Click me'; return true">

Then 'Click Me' will appear in the browser's status bar when the mouse moves over this link. (this only works with Netscape versions 2 and later, and Internet Explorer 3 and later)

Putting text inside a table with a specified width can make it much more legible, although you risk alienating a few people with archaic browsers. For example,

<table width=400>
<tr>
<td>
This is where the text goes. Blah blah blah, latin latin latin
</td>
</tr>
</table>
This piece of code will limit the width of your text to 400 pixels, leaving the rest of the screen as whitespace. The text on this page is in a table 420 pixels wide.

There are a number of meta tags which can be added within your page's header for completeness. Common ones include description, which gives a brief summary of the page and keywords which lists words relevant to the topic of your page, but not necessarily mentioned in the text of the page. Both of these tags are used by search engines such as AltaVista and Hotbot when they index your page. The code for them will look something like:

<META NAME="description" CONTENT="This is the Homepage of Daniel (Nathan?) Sumption. If you're looking for me, this is where I am. All links spring from this page. That's it!">

<META NAME="keywords" CONTENT="Daniel Sumption Daniel Sumption Daniel Sumption Hard Media Web Designer Space-pop bassist general,all-round good egg Daniel Sumption oh did I mention the Nathan? Caustic">

Other tags I have come across include those for specifying the content type and alphabet used in your page:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
And the page's author:
<META NAME="Author" CONTENT="Dan Sumption">
Meta tags which include HTTP-EQUIV rather than NAME perform the same function as the equivalent Hypertext Transfer Protocol command (got that?), so:
<META HTTP-EQUIV="Refresh" content='30; url="http://www.mysite.com/nextpage.html"'>
instructs the webserver to perform a Refresh command using the given content. In this case, the result is that in 30 seconds the current page will be replaced with the page http://www.mysite.com/nextpage.html. Sending a Refresh command with no url means that the current page will be reloaded after the specified wait.

There are also various schemes which generate meta-tags for rating your pages according to their content. For example, RSAC allows you to specify levels of nudity, sex, violence and bad language on your page, then generates a meta-tag which certain browsers can use to protect the innocent from your evil creations. It will look something like:

<META HTTP-EQUIV="PICS-Label" content='(PICS-1.0 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" by "dan@sumption.org" for "http://www.fictionalsite.com" on "1996.04.16T08:15-0500" exp "1997.07.01T08:15-0500" r (n 4 s 4 v 4 l 4))'>
(if, that is, you have a particularly salacious site!)

Remember that all <META> tags must come in between the <HEAD> and </HEAD> tags in your document. If you find any more interesting meta tags, let me know.

Finally (for the time-being), if you are using a background texture on your page then remember to set the background colour of the page to match the texture. For example:

<body background="blackblobs.gif" bgcolor="#000000" text="#ffffff">
The reason for this is that if, for some reason, your background image won't display (like if it's corrupted or deleted or moved or incorrectly spelt or any of the 5,000 other reasons) then at least people will be able to read what's on the page. Otherwise, white writing on a light grey background (or whatever) may cause unnecessary eye-strain. As an added bonus, people will be able to start reading the text on your page before the background has finished downloading.

Top of page


GRAPHICS
Make sure that text in images is anti-aliased: this means that intermediate colours are added between the colour of the text and the colour of the background. This makes diagonal lines smoother - without anti-aliasing, you often see 'steps' along the course of a line, know as 'the jaggies'. Anti-aliasing in effect blurs these steps into the background. When applying text in Adobe Photoshop, anti-aliasing is used by default.

Transparent images also need this smoothing effect along any edges which are not horizontal or vertical. To achieve this, you must make the background (the area to become transparent) the same colour as, or similar to, the colour you will use as your webpage's background. Again, in Photoshop the fill tool will create anti-aliased edges by default. However, there can be problems, such as when your page's background has more than one colour (although similar colours - such as a range of light blues - will not be noticeably affected), or when the picture uses the same colours as the webpage's background (e.g. if the background is white, white areas in your picture will come out transparent)..

Animated gifs are a whole 'nuther kettle of fish, and I will tackle them when I have a few months to spare!

Top of page


HTML FRAMES
These hard-to-tame screen-guzzling beasties should be handled with extreme caution. That said, there are 'right times' to use frames. I would use a simple small frame along one side of the screen (maybe top or bottom, though vertical space is limited enough already) as a navigation device. You can put a few navigation icons in here, so that they are always on screen when the viewer scrolls through the page. I would use a more complex set of frames when the user is browsing through some multi-tiered hierarchical system. For example, the website may contain regional and local maps of the UK. The initial frame shows a map of the UK. A second frame will contain a map of the county clicked in the first frame, while a third frame will show the town clicked on in the second frame. Without having to move back through previous pages, the viewer can either select a new town in the current county, or select a whole new county, as the frames showing these maps are still in full view.
Frame sizes are set up using the <frameset> tag, which replaces the <body> tag. The <frame> tag specifies the source of the page which will fill that frame. Text to be displayed if the viewer's browser does not show frames should be placed in a <noframes> block.

To set up two frames, one 100 pixels wide, the other filling the remainder of the screen, use:

<html>
<head>
<title>
Some Frames
</title>
</head>
<frameset cols="100,*">
<frame src="narrowframe.html" name="sidebar" marginwidth="0" marginheight="0" scrolling=no NORESIZE>
<frame src="remainderframe.html" name="mainwindow">
<noframes>
This page looks best with frames, but just so that you don't feel left out, you can still see <a href="remainderframe.html">the main part</a> of the page.
</noframes>
</frameset>
</html>
When a link within a frame is chosen, the browser loads the next page in the same frame by default. In the above example, to make a link in the side window load a page into the main window you would use
<a href="newmainwindow.html" target="mainwindow">

For a more complex display, where framesets are nested, you could use:

<html>
<head>
<title>
Some More Frames
</title>
</head>
<frameset cols="50%,50%">
<frame src="ukmap.html" name="mainmap">
<frameset rows="3*,2*">
<frame src="avonmap.html" name="countymap">
<frame src="bristolmap.html" name="townwindow">
</frameset>
<noframes>
This page can only be viewed properly using a browser with frames. Please use our <a href="noframes.html">non-framed</a> version of the map.
</noframes>
</frameset>
</html>

Top of page


PERL
Always start the program with the correct path to your perl interpreter

#!/usr/bin/perl

Always save your perl files using UNIX linebreaks - Programmer's File Editor for the PC or BBEdit for the Mac can both do this.

To send output as html, make sure that you print "Content-Type:text/html\n\n" to the standard output before anything else. The "\n\n" is two newlines.

[Hopefully, I will soon get around to writing a perl wrapper program which handles all sorts of useful web-type things, and you'll be able to steal it from me here!]

Top of page

Rowan