The first article in this series, Developing Web Pages for Teaching, Part I -Introduction, discussed the basics of what a web page can do and what might beuseful. This second article talks about the details of how you actually create a webpage and put it out there for the world to see. There are lots of different ways to dothis, and there are lots more details than I can present here. This is simply a startingpoint to get you moving. It is based upon my experience teaching other faculty how towrite web pages. Many of the details will be different for your computer system, butthere should be enough information here that you can at least talk to the technicalexperts at your school to get upand running. Good luck.
Tables are one of the most useful tools for controlling the layout of a web page. In a web page a table does not have to be a data table, instead it is a way to organize page layout. You can use it for traditional data tables, but it is much more flexible than this. Be warned, however, that the apperance of a table can vary dramatically depending upon the viewers browser and monitor settings. I caution you not to try and specify an exacting page layout that makes everything perfect on your computer. If you do, it will probably come out terribly on another. Give up some of the control and let the browser make some of the decisions. It may not look perfect, but it will usually be pretty good.
This table is created using the HTML shown below.
Top Col 1 | Top Col 2 | Top Col 3 |
---|---|---|
data 1a | data 2a | data 3a |
data 1b | data 2b | data 3b |
data 1c | data 2c | data 3c |
<TABLE WIDTH=60% ALIGN=center BORDER> |
Useful Features for the Data Tag. Add these elements to a data tag as needed.
Frames are very useful for producing web pages that are easy to navigate. However, they are a bit complex to develop. With a set of templates, this is much easier. The basic layout is that you use a set of individual HTML documents to generate the frame set. The first HTML document specifies how the window will be divided (horizontal or vertical) and the number and size of each frame. This first document then specifies the name of the document to place in each frame. Frames may be nested and linked in a variety of ways to provide very useful navigation features. The best way to learn how this can be useful is to look at some frame sites. This is also a good way to learn how frames can cause problems.
<FRAMESET ROWS=30,70> <FRAME SRC="header.html" NAME=Top> <FRAME SRC="bottom.html" NAME=Bottom> </FRAMESET> |
<FRAMESET COLS=100,*> <FRAME SRC="left.html" NAME=left> <FRAME SRC="right.html" NAME=right> </FRAMESET> |
These HTML documents may be used as a templates to develop a set of frames. Copy and paste the HTML code from the table below into an HTML editor for use. You can click on the link to see how it works, and you can right click on the link to save the file.
<title>Template for a set of horizontal frames</title> <!-- Sets default target for any link to the "_top" window. Any link without a specified target will load into the full window. This prevents accidental nesting of frames --> <base target=_top> <FRAMESET ROWS=30,70> <!-- Define the frameset. As rows dividing the available space 30:70. Changing these numbers will change the relative size of the frame. You may specify more than two rows. --> <!-- Defining the document to place in each of the frames. The NAME, defines the name of the frame for future reference. --> <FRAME SRC="top.html" NAME=Top> <FRAME SRC="bottom_1.html" NAME="Bottom"> </FRAMESET> <!-- The NOFRAMES part of the document is ignored by frames capable browsers. Browsers that can not view frames will see any information in this tag. Use this to provide access to users with old browsers. --> <NOFRAMES> This document is designed to view with a frames capable browser. If you see this, you should seriously consider upgrading your web browser. You may view the individual frames using the links below. <ul> <li><A HREF="top.html">Link to top frame</A> <li><A HREF="bottom.html">Link to bottom frame</A> </ul> </NOFRAMES> |
<title>Contents of Top Frame</title> <base target=_top> <H2 ALIGN=center>Contents of Top Frame</H2> This HTML document may be designed like any other HTML document. It is displayed in the top frame. It is possible to update other frames using links to new documents or to specific locations in the current document. Like Bottom Document 1, spot <A HREF="bottom_1.html#A" TARGET="Bottom">A</A> or <A HREF="bottom_1.html#B" TARGET="Bottom">B</A>. Or you can load a different document in the bottom Like Document <A HREF="bottom_2.html" TARGET="Bottom">Bottom 2</A> |
<title>This is the HTML document for the bottom frame</title> <base target=_top> <H3>This is the HTML document for the bottom frame</H3> This document may contain any HTML code. It is displayed in the bottom frame.<P> You may specify names for different locations in the document.<P> For example this is spot <A NAME="A">A</A> <BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR> This is part <A NAME="B">B</A> (it is located further down the page) |
<title>This is the HTML document for the bottom frame</title> <base target=_top> <H3>This is a different HTML document that is loaded in the bottom frame</H3> |
<title>bottom frame</title> <base target=_top> <FRAMESET COLS=400,*> <FRAME SRC="left.html" NAME=Left> <FRAME SRC="right.html" NAME=Right> </FRAMESET> |
<title>Contents</title> <base target=_top> This HTML document may be designed like any other HTML document. It is displayed in the left frame. It is possible to update other frames using links to new documents or to specific locations in the current document. Like Right document, spot <A HREF="right.html#A" TARGET="Right">A</A> or <A HREF="right.html#B" TARGET="Right">B</A>. |
<HTML> <HEAD> <TITLE>1</TITLE> </HEAD> <BODY> This document is displayed in the right frame. <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> This is location <A NAME="A">A</A> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> This is location <A NAME="B">B</A> </BODY> </HTML> |
There are several different ways that images may be used with web pages. Most browsers can view two different types of graphics files. The GIF (Graphical Image Format) file format works best for line art and small images. This file type preserves sharp lines and gets excellent compression when there are large spaces with the same color. The gif image below is inserted with the following HTML code:
<IMG SRC="h_int_d.gif" ALT="Proton NMR Spectrum of citronellal" WIDTH=545 HEIGHT=322>
Notice that the HTML code specifies the width and height of the image. This allows the browser to format the rest of the web page while the image downloads. If the image size is not specified the browser must wait to render the rest of the document. The ALT command in the tag specifies text to displayed until the graphic downloads. It is also important for readers with limited vision who rely upon a text to voice program to hear a web page.
The JPEG (Joint Photographic Experts Group) file format works best for photographs and color images. Some resolution is lost for line art (lines are not as crisp) but file size for photographs is dramatically reduced. This compression works by using shades of color to reduce the file size.
<IMG SRC="sey98h.jpg" ALT="Taking a sextant reading " WIDTH=301 HEIGHT=198>
Because images files can be large, spend some time editing the graphic so that it is as small as practical and use as much compression as you can. If you really need to use a high resolution image it is good form to include a thumbnail in the web page. This small image is a link to the full size image. Interested readers can then download the high resolution figure.
This is an extremely useful feature for teaching. Images can be used for links. By using an image map, it is possible to specify different links to different parts of an image. One example for how this could be used is a web page where selecting a different section of an NMR spectrum brings up a discussion of that peak. There are lots of possibilities to how this could be used.
The first step is to find an image and then map out the areas of interest. The maps are created by pixel in the image. Some web page creation software includes features to help with this. Doing it by hand is VERY tedious. An example of an image map is given below.
<map name="isobutanol"> <area alt="3.4 ppm doublet" coords="12,125,59,257" href="3_4_ppm.html"> <area alt="2.6 ppm singlet" coords="169,170,218,254" href="2_6_ppm.html"> <area alt="1.7 ppm multiplet" coords="332,211,379,253" href="1_7_ppm.html"> <area alt="1.7 ppm multiplet zoom" shape="circle" coords="346,125,71" href="1_7_ppm_zoom.html"> <area alt="0.9 ppm doublet" shape="poly" coords="506,254,541,254,540,5,504,3,497,188" href="0_9_ppm.html"> <area alt="isobutanol proton NMR" shape="default" href="imagemap1.html"> </map> <img src="ib_01_0a.jpg" width="559" height="300" border="0" usemap="#isobutanol"> |
The EMBED tag is used to place an object that requires a plug-in into a web page. There are several different uses of this in chemistry. But the most common is to include a molecular structure for CHIME. The most useful feature is that the embed tag lets you pass commands to the plug-in. This allows you to open a structure in CHIME and set the display parameters. For example the tag below:
<embed src="sf6.pdb" TYPE="chemical/x-pdb" width="400" height="300" spinx=60 spinfps=10 startspin=yes spinZ=10 spinX=30 spinY=30 display3D=ball&stick>
Will display as:
For a comlete listing of the embed tag options with CHIME see the MDL CHIME web page.
For more on the embed tag, see Netscape Embed Tag
Scripts are programming languages that allow user interaction with a web page. One way to do this is with CGI scripts. CGI is a protocol that allows a web browser to submit information to a server. The server then runs a script using this information. Most commonly the script sends an e-mail or returns a web page to the browser. Pearl is a programming language that is frequently used to with CGI scripts. The idea here is that cgi scripts can make web pages respond to a user input.
Javascripts are similar, but they actually run in the browser. Javascript is different than Java (a programming language that is much more complex). Javascripts let you do lots of useful things for teaching chemistry. One of the most common applications is to generate problem sets using random numbers and for online testing. Some of the features are a bit primitive, but there is lots of potential. Before diving in, be forwarned that javascripts are browser dependent. IE, Netscape, and Opera have all implemented slightly different versions of javascript.
The best way I know to write Javascript is to find something similar and modify it for your use. If you really want to learn Javascript, it is beyond what this article can accomplish. This is just a starter.
To see what a javascript can do, take a look at some of George Wigers online Lecture Help Pages with Solutions. These are designed to use with Netscape.
Go to your favorite search engine and search for "javascript library", "cgi" or "pearl script" to find lots of examples and information.
Look at the program hot potato. This program creates scripts for online quizzes and more.