HTML Frames
HTML frames allow authors to
present documents in multiple views, which may be independent windows or sub windows.
Multiple views offer designers a way to keep certain information visible, while
other views are scrolled or replaced. For example, within the same window, one
frame might display a static banner, a second a navigation menu, and a third
the main document that can be scrolled through or replaced by navigating in the
second frame.
<HTML>
<HEAD>
<TITLE>A frameset document</TITLE>
</HEAD>
<FRAMESET cols="33%,33%,33%">
<FRAMESET rows="*,200">
<FRAME src="contents_of_frame1.html">
<FRAME src="contents_of_frame2.gif">
</FRAMESET>
<FRAME src="contents_of_frame3.html">
<FRAME src="contents_of_frame4.html">
</FRAMESET>
</HTML>
An HTML document that describes
frame layout (called a frameset document)
has a different makeup than an HTML document without frames. A standard
document has one HEAD section and one BODY. A frameset document has a HEAD, and a FRAMESET in place of the BODY.
The FRAMESET section of a document
specifies the layout of views in the main user agent window. In addition, the FRAMESET section can contain a NOFRAMES element to provide alternate
content for user agents that do not support frames or are configured not to
display frames.
Setting the rows attribute defines the number of horizontal
subspaces in a frameset. Setting the cols attribute defines the number of
vertical subspaces. Both attributes may be set simultaneously to create a grid.
If the rows attribute is not set, each column extends the
entire length of the page. If the cols attribute is not set, each row extends
the entire width of the page. If neither attribute is set, the frame takes up
exactly the size of the page.
Framesets may be nested to any level.
In the following example, the outer FRAMESET divides the
available space into three equal columns. The inner FRAMESET then divides the
second area into two rows of unequal height.
<FRAMESET cols="33%, 33%,
34%">
...contents of first frame...
<FRAMESET rows="40%, 50%">
...contents of second frame, first
row...
...contents of second frame, second
row...
</FRAMESET>
...contents of third frame...
</FRAMESET>
Specifying target frame information
This attribute
specifies the name of a frame where a document is to be opened.
By assigning a name to a frame
via the name attribute,
authors can refer to it as the "target" of links defined by other
elements. The target
attribute may be set for elements that create links (A, LINK), image maps (AREA), and forms (FORM).






0 comments:
Post a Comment