This chapter outlines some of the most important extensions to HTML that are supported in HoTMetaL PRO.
Note: You should bear in mind that not all of the extensions described here are supported, or supported in the same way, by all Web browsers. Some are currently supported by only a single browser. We strongly recommend that you consult the documentation provided by the specific vendors.
HTML usage is constantly changing: new features are invented, and new versions of browsers extend their support for existing features. In this document we have tried to represent current and proposed usage as of the time of this writing. Any identification of features of a specific product is included for the information of users, and should not be interpreted as an endorsement by SoftQuad Inc.
Frames allow you to divide the browser window into multiple regions, each displaying a different document.
Note: Frames, while commonly used, are not part of the HTML 2.0 specification, and are therefore not supported by all Web browsers. Use this feature with caution, and make sure that you have alternative pages for non-frame browsers and that all frame documents contain markup readable by non-frame browsers (i.e., use the NOFRAME(S) element).
A document that contains frames has a FRAMESET (frame set) element as the top-level document content element instead of the BODY element. A frame set divides the browser window into rectangular regions. Each such region can be:
For example, a frame set can contain a frame, plus another frame set containing two frames, resulting in three frames in all.
A frame document can also contain a NOFRAMES element, which contains a BODY element. If a frame document is viewed by a browser that does not support frames, the contents of the NOFRAMES element will be displayed by that browser.
To create a FRAMESET element select Convert to Frames from the Tools menu. This will insert a FRAMESET element and surround the BODY element with a NOFRAMES element.
Note: We have also included the element `NOFRAME' (note the different spelling) because some sources appear to use this spelling of the element name. `NOFRAMES' seems to be the preferred form.
You can create and edit a frame document in HoTMetaL PRO by inserting frame markup and editing frame set and frame attributes.
It may be easier to work with frameset documents in HoTMetaL PRO if you have loaded a styles file-such as showall.asf-that makes some of the attributes of frames visible.
The attributes of the FRAMESET element determine how many regions the frame set is divided into. To edit the attributes:
A FRAMESET has ROWS and COLS (columns) attributes. These attribute names emphasize that a frame set can be thought of as a table or grid. These attributes may be blank, or consist of a list of one or more values separated by commas. Each such value determines the width (for columns) and height (for rows) of the regions; the number of width and height values supplied determines how many rows and columns, respectively, are created. The default for each is one. For example, if you set COLS to:
20%,30%,50%
and don't supply a value for ROWS, the frame set will be divided vertically into three regions: the first region's width will be 20% of the current frame set (or browser window if this frame set is at the top level), the second region's width will be 30%, and the third region's width will be 50%. If there is only one frame set in the document, these widths will apply to the entire browser window. Similarly, if you supply a value only for ROWS, the frame set will be divided horizontally into regions. If you supply values for both attributes, the frame set will be divided into a grid of rows and columns.
This small document will cause three frames to be displayed. The first (outer) FRAMESET element divides the browser window into two horizontal regions. the upper region contains a single frame displaying the document http://www.sq.com/, and the lower region displays the frames defined in the second (inner) FRAMESET element. This FRAMESET divides the lower part of the window into two vertical frames, displaying the documents http://www.sgmlopen.org/ and http://www.w3.org/.
<HTML> <HEAD><TITLE>Three frames</TITLE><HEAD> <FRAMESET ROWS="40%,60%"> <FRAME SRC="http://www.sq.com/"> <FRAMESET COLS="50%,50%"> <FRAME SRC="http://www.sgmlopen.org/"> <FRAME SRC="http://www.w3.org/"> </FRAMESET> </FRAMESET> </HTML>
You saw above that you can specify the width or height of a frame as a percentage of the area allotted to the frame set that it's a member of. There are actually three ways to specify these:
Absolute sizes are not always a good idea, since the actual browser window size will vary.
A `relative size' is specified with an asterisk, e.g., `1*', `2*', `3*' (`1*' can also be written simply as `*'). This is interpreted as follows: after all widths (or heights) specified as percentages or absolute amounts have been allocated to the corresponding frames, the remaining space will be allocated to frames whose widths (or heights) have been specified as a relative size. The amount of space allocated to a frame is proportional to the number in front of the asterisk. For example:
<FRAMESET ROWS="30%,400,*,2*"> ... </FRAMESET>
Suppose the browser window is currently 1000 pixels high. The first frame will get 30% of the total height, that is, 300 pixels; the second frame will get 400 pixels, since an absolute amount was specified. This leaves 300 pixels to be divided between the other two frames. The fourth frame's height is specified as `2*', so it will be twice as high as the third frame, whose height is only `*' (1*). Therefore the third frame will be 100 pixels high and the fourth will be 200 pixels high.
You can specify that a document referred to by an anchor should be displayed in a specific frame. To make this possible, the frame itself must be given a name.
There are two ways to specify which frame a document will be displayed in:
If both methods are used, the frame name specified in the anchor takes precedence.
When you click on a link to the document, it will be opened in the specified frame if that frame exists; otherwise, a new window will be created.
Here is an example (in HTML format) of targeting specific frames using an anchor element. First, the document containing the frames:
<FRAMESET ROWS="33%,33%,33%"> <FRAME NAME="upper" SRC="blueback.htm"> <FRAME NAME="middle" SRC="sources.htm"> <FRAME NAME="lower" SRC="blueback.htm"> </FRAMESET>
To create this document:
Rows field, separated by commas.Name field to upper and the SRC field to blueback.html.name field to middle and the SRC field to sources.html.name field tolower and the SRC field to blueback.html.
Here is a fragment from the document sources.htm, referred to in the middle frame above.
<P><A TARGET="upper" HREF="http://www.sq.com/"> SoftQuad Home Page </A> <BR> <A TARGET="lower" HREF="http://www.w3.org/"> W3 Consortium Home Page </A> </P>
To create this document:
Since each frame should have a default document, we suggest that you create a file called blueback.htm that has no content, but has the document background color set to blue.
When you load the frame document in a browser, three frames will be displayed. The middle frame will contain the document sources.htm, and the other two frames will be blank. If you click on the first anchor in sources.htm, the the document http://www.sq.com/ will be displayed in the upper frame; clicking on the second anchor will cause the document http://www.w3.org/ to be displayed in the lower frame.
Note: At the time of this writing, browsers are unable to target a specific frame unless that frame has a `default' document.
The following strings have special meanings when used as target values in anchors (note that all of these start with an underscore character):
In addition to SRC and NAME, FRAME elements have the following attributes:
See our frame tutorial, available from the How-To Index. See also the Technical Reference page in the Help menu.
Java is a programming environment that operates in conjunction with certain browsers to allow you to insert programs, called applets, in an HTML document.
Note: Applets are not part of the HTML 2.0 specification, and are therefore not supported by all Web browsers. Use this feature with caution, and make sure that you have defined alternative text and applet-internal block elements for non-applet browsers.
Wherever an applet occurs in a document, it reserves an area on the browser screen in which it does some special processing, such as drawing a picture or interacting with the user.
HoTMetaL PRO supports the APPLET element for inserting applets. This element is used by the current release of Java. The APP element, used by the `alpha' version of Java, is not supported by HoTMetaL PRO. The APPLET element can appear only inside certain `block' elements-paragraphs, headings, list items, tables, and CENTER-or their nested sub-elements.
You can insert applets into HoTMetaL PRO in two ways:
The attributes of the APPLET element specify the applet file and the area on the screen in which it operates. The following attributes
are set automatically if you use the
toolbar button to choose an applet file. They can be set manually by
editing the attributes of the APPLET.
When you use the
toolbar button to insert an applet, the Applet Attributes dialog box appears. You can bring up this dialog box at any time by placing your
cursor inside the APPLET element and choosing Applet Parameters... from the Markup menu. You can set the
following attributes:
If the applet code requires some input data, this can be provided in the document itself, by way of PARAM elements. If these exist, they must be the first subelements of the APPLET element. A PARAM element doesn't have any content; the information it supplies is contained in its attributes:
There are two other attributes of PARAM: VALUETYPE and TYPE, which are used for PARAM within OBJECT. They are not used for PARAM within APPLET.
An APPLET can contain `block' elements such as paragraphs, lists, and blockquotes. If present, these must appear after any PARAM elements. The content of these elements will be displayed only in a non-Java environment (either because the browser isn't Java-aware, or because Java display has been turned off).
Coding applets is beyond the scope of this manual; choose Technical Reference from the Help menu for references to Java.
SCRIPT elements contain code, written in one of several programming languages, that is executed by a script-aware browser. JavaScript and Visual Basic Script are two such programming languages. The SCRIPT element allows you to put code directly in an HTML document. JavaScript is supported by version 2.0 of Netscape Navigator, and perhaps by other browsers. Visual Basic Script is supported by Microsoft Internet Explorer version 3.0 or greater.
Note: SCRIPT is not part of the HTML 2.0 specification, and therefore is not supported by all Web browsers. Use this feature with caution, and make sure that your script-enhanced documents contain markup readable by all browsers.
The actual code is usually placed between the start- and end-tags of a SCRIPT element. You can insert a SCRIPT element by using the Insert Element... command in the Markup menu. You can edit the SCRIPT element's attributes using the Element Attributes... command in the Markup menu.
The SCRIPT element has the following optional attributes:
The following attributes of SCRIPT are less common and are subject to change.
http://www.sq.com/orwell.htm#ID:catalunya
Often, the script element is surrounded by a comment or contains a comment so that the script contents can be hidden from browsers that do not understand the SCRIPT element. If you type the following sequence at the beginning of a script element before the code, the script will be ignored by most non-script capable browsers. Type:
<!--
just after the <SCRIPT> start tag, and:
-->
just before the </SCRIPT> end-tag.
In addition to the script code, scripts can make use of attributes of other elements. These attributes define user input to a script. There is one form element that has been created especially for scripts: an INPUT element of type `button' allows users to send data to a script as distinct from a `submit' or `reset' button). The attributes will not be described here, but the following list notes them:
onBlur: attribute of INPUT,
SELECT,
TEXTAREA.onClick: attribute of INPUT,
A.onChange: attribute of INPUT ,
SELECT,
TEXTAREA.onFocus: attribute of INPUT,
SELECT,
TEXTAREA.onLoad: attribute of BODY or
FRAMESET.onMouseOver: attribute of A.onSelect: attribute of INPUT,
TEXTAREA.onSubmit: attribute of FORM.onUnload: attribute of BODY or
FRAMESET.The details of how to code in JavaScript or Visual Basic Script are beyond the scope of this manual; choose Technical Reference from the Help menu for more information.
A scrolling marquee is a piece of text that scrolls across a rectangular area that you define in the browser window. You specify the height and width of the marquee area, and then (if desired) specify margins. The scrolling text will be visible between the margins. Surrounding text can be aligned with the marquee area as you wish. This feature was introduced by Microsoft for Internet Explorer 2.0.
Note: Marquees are not part of the HTML 2.0 specification, and are therefore not supported by all Web browsers. Use this feature with caution, and make sure that all marquee documents contain markup readable by all browsers.
To create a marquee:
The attributes of MARQUEE tell the browser exactly how the text will be displayed and scrolled. You can edit these attributes with the Element Attributes... command in the Markup menu.
Choose Technical Reference from the Help menu for references to marquees.
The following text formatting elements are available from the markup commands (Insert Element... and Change Element...).
Note: These elements are not supported by all browsers. Use them with caution, and make sure that your pages look acceptable without these elements.
This feature is not supported by all browsers. Note also that many font names are platform-specific-a font that is understood by a Macintosh browser may not be understood by a Windows browser, and vice versa.
The elements in this section can be created using Insert Element... or Change Element...; the attributes can be edited using Element Attributes.... All of these commands are in the Markup menu.
Note: These elements are not supported by all browsers. Use them with caution, and make sure that your pages look acceptable without these elements.
Many elements have the attributes listed below. These attributes are extensions to the HTML 2.0 specification that are to be used with such forthcoming HTML features as cascading style sheets. They are not currently used by most Web browsers, and, for the most part, you can safely ignore them. The following is a brief definition of these attributes: for a full explanation, read the HTML 3.0 specification. See the HoTMetaL PRO `Technical Reference' page for the URL for this document.
The attributes of EMBED are:
Netscape Navigator also allows you to insert variable or application-specific attributes. These cannot be represented in SGML and therefore are not supported by HoTMetaL PRO. If you want to insert such attributes, you should open the HTML file with a text editor and insert the attributes manually, inside the EMBED start-tag. A file that contains these attributes cannot be opened with HoTMetaL PRO.