Frame structure (frame)
Window Segmentation Technology (FRAMES) allows your browser simultaneously display multiple windows, each window displays different file content. Let readers also browse multiple HTML files at the same time and can easily switch between different images. It is like a multi-screen TV.
Each area divided by window segmentation technology is called Frame, its originality is a framework, just like a few separate pictures on the screen.
The structure of the Frames structure is substantially similar to the general HTML file, just change the HTML file main tag body to Frameset.
A typical Frames structure is as follows:
html>
As can be seen from this structure, all the contents of Body in ordinary HTML files are included within Frameset. That is, in the same HTML file, the frameset element cannot be used, and both cannot appear at the same time.
Every frame has the following features:
1) You can specify a corresponding URL address, and each framework of the same layout can be independently loaded into information.
2) You can specify the frame name as the target points to the other URL.
3) It can be arranged to be rolled with a variable dynamic frame, and can also be set to a size fixed static frame.
2. Set the frameset (Frameset)
Tags
1) ROWS =
Definition The number of points to the top and bottom partitions and the height size ratio of each part.
Example 9-1
Indicates that the window is divided into three parts, each of which is 100, 200, 300 pixel points, respectively.
2) COLS =
Define the number of pieces divided by the window and the width ratio of each portion.
Example 9-2
Indicates that the window is divided into two parts, each of which is 300,200 pixel points, respectively.
Note: In a Frameset tag, the ROWS and COLS parameters can only appear, and they cannot appear at the same time.
The value of the ROWS and COLS parameters is removed from the pixel point, and the percentage is relative value.
Example 9-3
Indicates that the window is divided into two parts, each accounting for 30% and 70% of the height. If the total percentage is insufficient or more than 100%, insufficient or exceeds the part will be averaged to each frame.
Use the "*" to represent the value of ROWS or COLS. It represents factors of each frame size.
Example 9-4
Indicates that the left and right are three parts, the first part is 200 pixels, the second, and the third part each accounts for half of the remaining width.
Example 9-5
Indicates that the window is divided into three parts, and its height ratio is 1: 2: 3.
3. Frame content tag (FRAME)
Tag defines the specific content of the framework. Common parameters are:
1) Frame content parameter SRC =
Used to specify the content displayed in the window. Usually used with a URL address. SRC is the necessary parameters necessary, if not, the framework will not be content.
2) Framework Name Parameters Name = is used to name a frame.
Example 9-6
Try "Left1" to the left window. Its display content is a file called "left.htm". Other windows use a similar approach to get the name for other parts. It will be convenient to specify the destination address of a LINK appearing on the window. This use is similar to the role of .
3) Frame boundary width: marginheight = and marginwidth =
The framework of the left and right, the boundary width is defined by "marginwidth =", the framework of the up and down, the boundary width is defined by "marginheight =". They are all pixel points.
If the boundary width is not set, it is determined by the browser yourself.
4) Set the frame roller: scroling =
The rolling strip can be horizontally, and the ordinate is simultaneously set. It has three values: Yes, NO, and AUTO, the default value is auto. Indicates that the browser automatically determines whether the roller is displayed.
5) The frame of the frame can change parameters: NoResize
When the size of the frame is changing, it can be changed. This can be used by the user with a mouse point, and then drag the mouse to make any adjustment. However, if the Moresize property is added in the Frame tag, the size of the frame is fixed unchanged.
4. Table format frame
Frameset does not bring both ROWS and COLS attribute parameters, which is to say that it can only split the window in one direction. That is, segment it up and down, or separately. Can you divide the window at the same time, and form the frame structure of the table format?
The answer is yes. Nested use of the Frameset tag.
Example 9-7, to split the window to two equivalents, the upper part is divided into left and right parts, the size ratio is 30%, 70%. The lower half is divided into three equivalents, and the following labels can be used:
frameset>
The first line, segment the screen, second, three behavior sub-frame (Subframe). The second line divides the upper half into two parts, and the third line divides the lower half into three equals. The fourth behavior ends of the outer Frameset.
5. Adapt to the browser that does not support the frame
There are many low version of the browser that does not support the HTML file of the frame structure, the display of the frame structure HTML files in this type of browser becomes a confusion, or there is no display at all. In order to use the user who does not support the Frame browser, you can use the NOFRAME tab to display the contents to the NOFRAME tag. When such a user browsses, the Frame tag is ignored, but the content in will display normally, just Unsecured window. When using a browser that supports Frame, tag is ignored, and the contents of will be displayed normally in the split window.
Here is a complete example:
Example 9-7Frame instance (this example can only display the split window on a version higher than Netscape 2.0.)
Will only see this information !!
center>
Split the browser window into four parts: named: Left1, Right1, LEFT2 and RIGHT2. The display content of these four windows is four html files: left1.htm, right1.htm, left2.htm, right2.htm, their source code as follows:
LEFT1.HTM:
Right1.htm:
LEFT2.HTM:
The display is shown in Figure 9.1 in the browser.
Figure 9.1Frame instance shows
As seen from the figure:
1) Each framework is equivalent to a complete browsing window.
2) Since Left1 sets the NORESize parameter, its size cannot be touched by dragging the mouse. Thus affecting the boundaries of the upper and lower parts cannot be changed, the relative size of LEFT2 and RIGHT2 can be arbitrarily adjusted.
3) When the content of a frame cannot be displayed all, the rolling strip appears, prompting the user to display the rest of the rest by dragging the roller strip. When the direction content can be fully displayed, the roll strip does not appear (such as the horizontal direction of Letf1). If a frame sets the parameters: scrolling = "no"
The rolling strip does not appear (Right2).
4) This example is part of the content is surrounded by the NOFRAME tag. This part is not shown in Figure 9.1. However, if you do not support the Frame structure, you can only see this section, and you can't see the split window.
6. Application of Frames Structure
Using the framework can split the window into their own separate parts, we can design some of the very distinctive HTML files.
One of the ideas is: Put the readers often see the screen, such as a directory, control button, the subject sign, copyright statement, the author address, etc. in a static frame, and do not flow with the screen. Enables readers to query anytime.
Another part of the dynamic framework relative to the static frame is used to display a lot of information for browsing. While reading, the reader can find the directory or control button from the static framework at any time, and hop the switches as you want. Greatly improve query efficiency.