|
Besides the SRC attribute, the <FRAME> tag features several other attributes, the NAME attribute being the most important one. You can target a link or a form submission return by a frame’s name. Names must start with an alphanumeric character. There are two attributes that deal with a frame’s margin:
The “margin” is the spacing between the frame’s content and its borders. The minimum value for a margin’s width or height is 1, and its maximum value is the frame’s thickness. Both MARGINHEIGHT and MARGINWIDTH specify the margin value (height or width, respectively) in pixels. The SCROLLING attribute is another important one. It accepts one of three values:
The default value "auto" instructs the browser to make a scrolling frame (with a scrollbar) whenever needed. The browser’s algorithm is very simple—if the length or width of the frame’s content exceeds the frame’s physical size, a scrollbar is provided. The other options, "yes" and "no", force a decision on the browser. A powerful feature of frames is that the user can resize them by dragging. You can disable this option by specifying the NORESIZE option. Targeting FramesFrames are powerful because they enable the content provider to direct various documents to specific frames. Directing a document to a frame is referred to as targeting. Targeting is supported in HTML via the TARGET attribute, which you can add to a variety of tags in the following fashion:
TARGET="windowName"
Since frames act as independent browser windows, they are often called as such. The classic usage of the TARGET attribute is with hypertext links, according to the following syntax:
<A HREF="URL" TARGET="windowName">text or image</A>
You should place such a link in a document that resides within a frame. windowName is the name of the frame in which the URL document should load. You can use the <BASE> tag’s TARGET attribute for targeting most of a document’s links to a single common frame. The TARGET attribute establishes a default windowName that all links in a document will be targeted to. This default can be overridden by specific instances of the TARGET attribute in individual anchor tags. The general syntax of the <BASE> tag’s TARGET attribute is as follows:
<BASE TARGET="windowName">
Note that this definition should be placed at the beginning of the HTML document. As you can see, it is possible to target a document to a named frame. There are reserved names that define specific locations:
Nested FramesThere are basically two ways to nest frames. The easiest way is to use a simple <FRAMESET> tag in the top-level document to define several rows or columns of frames, and then use another <FRAMESET> tag in one or more of the frame documents to further divide it. Suppose you want to divide a window into two columns, where the second column is divided into two rows. You can define a two-frame <FRAMESET COLS="…"> construct in the eArent document as follows:
<FRAMESET COLS="50%, *"> <FRAME SRC="left.html" NAME="left"> <FRAME SRC="right.html" NAME="right"> </FRAMESET>
The document right.html would then need to be subdivided into frames by including the following definition:
<FRAMESET ROWS="50%,50%"> <FRAME SRC="topRight.html" NAME="topRight"> <FRAME SRC="bottomRight.html" NAME="bottomRight"> </FRAMESET>
Figure 26-3 demonstrates the deeply nested frame hierarchy: A more convenient way to nest frames is as follows:
<FRAMESET COLS="50%, *"> <FRAME SRC="left.html" NAME="left"> <FRAMESET ROWS="50%,50%"> <FRAME SRC="topRight.html" NAME="topRight"> <FRAME SRC="bottomRight.html" NAME="bottomRight"> </FRAMESET> </FRAMESET>
In this code, we define a set of two frames, where the second one is not specified via a <FRAME> but rather as another inner <FRAMESET> definition. Notice that this technique differs from the previous one, because all frames are directly defined in the top-level document. Figure 26-4 illustrates the structure of such a document. Notice that frames in a document are not directly connected to each other. However, HTML enables you to reference one frame directly from another one. Figure 26-5 shows the HTML connections between frames in such a structure:
|
|||||||||||||||||||||||
With any suggestions or questions please feel free to contact us |