frames. with frames, we can display more than one html document in the same browser window. each...

20
FRAMES

Upload: beverly-hubbard

Post on 27-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

FRAMES

Page 2: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

• With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window.

• Each HTML document is called a frame, and each frame is independent of the others

Page 3: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

Advantages of Frames

1. They allow parts of the screen to remain static while other parts scroll. This can be useful for navigation menus or logos that you don't want to scroll off the screen.

2. They can be handy when you want the user to be able to view a number of images chosen from a long list.

2. we can introduce material from different servers on the same page, simply by assigning the appropriate URL's.

Page 4: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

The disadvantages of using frames are:

1. The web developer must keep track of more �

HTML documents2. It is difficult to print the entire page3. Since a framed page is loading more than one

URL, it may load more slowly, particularly if calling upon different servers

Page 5: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

The Frameset Tag

1. The <frameset> tag defines how to divide the window into frames

2. Each frameset defines a set of rows or columns

3. The values of the rows/columns indicate the amount of screen area each row/column will occupy

Page 6: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

A FRAMESET's attributes 1. ROWS- Splits the window vertically into a number of rows specified by one of:

a) A number of rows. b) A percentage of the total window height. EX: ROWS="10%". c) It will divide the space evenly between frames if multiple frames are specified

with the asterisk. d) An asterisk means the frame will occupy all the remaining space.

2. ColS - Splits the window horizontally into a number of columns specified by one of: a) A number of columns. b) A percentage of the total window width. EX: ColS="10%". c) An asterisk means the frame will occupy all the remaining space. It will divide

the space evenly between frames if multiple frames are specified with the asterisk.

Page 7: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

3. FRAMEBORDER: Possible values 0, 1, YES, NO. A setting of zero will create a borderless frame.

4. FRAMESPACING:This attribute is specified in pixels. If you go to borderless frames you will need to set this value to zero as well, or you will have a gap between your frames where the border used to be.5. BORDER: Possible values 0, 1. A setting of zero will create a borderless frame.

6. BORDERCOLOR:This attribute is allows you choose a color for your border. This attribute is rarely used.

Page 8: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

The Frame Tag

The <frame> tag defines what HTML document to put into each frame

<frameset cols="25%,75%"> <frame src="frame_a.htm"> <frame src="frame_b.htm"></frameset>

Page 9: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

Attributes are…1.SRC: Required, as it provides the URL for the page that will be displayed in the frame. 2.NAME: Required for frames that will allow targeting by other HTML documents. Inorder for alink to display the retrieved file in a frame otherthan the frame in which the link was {Clicked} in,the targeted frame must be referenced by its name.

3.MARGINWIDTH: Optional attribute stated in pixels. Determines horizontal Space between the <FRAME> contents and the frame's borders. 4.MARGINHEIGHT:Optional attribute stated in pixels. Determines vertical space between the <FRAME>contents and the frame's borders.

Page 10: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

5.SCROLLING: Displays a scroll bar(s) in the frame. Possible values are:a) yes – always display scroll bar(s) b) no – never display scroll bar(s) c) auto – browser will decide based on frame contentsThe default value for this attribute is “auto”. 6.NORESIZE: Optional - prevents viewers from resizing the frame. By default the user

can stretch or shrink the frame'sdisplay by selecting the frame's border andmoving it up, down, left, or right.

Page 11: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

Vertical frameset

<html> <frameset cols="25%,50%,25%"> <frame src="frame_a.htm"> <frame src="frame_b.htm"> <frame src="frame_c.htm"></frameset></html>

Page 12: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

Horizontal frameset

<html> <frameset rows="25%,50%,25%"> <frame src="frame_a.htm"> <frame src="frame_b.htm"> <frame

src="frame_c.htm"></frameset> </html>

Page 13: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

Mixed frameset

<html>

<frameset rows="50%,50%">

<frame src="frame_a.htm">

<frameset cols="25%,75%"> <frame src="frame_b.htm">

<frame src="frame_c.htm">

</frameset>

</frameset>

</html>

Page 14: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

Frameset with noresize="noresize"

<html>

<frameset rows="50%,50%"> <frame noresize="noresize" src="frame_a.htm"> <frameset cols="25%,75%"> <frame noresize="noresize" src="frame_b.htm">

<frame noresize="noresize" src="frame_c.htm"> </frameset> </frameset>

</html>

Page 15: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

Navigation frame- Jump to a specified section with frame navigation

<html><head><title>navigation frame</title></head><frameset cols ="100,*"><frame src ="Try.html"><frame src = "olist.html" name="showframe"><frame src="marq.html" name="showframe"></frameset></html>

Page 16: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

Try.html<a href = "olist.html" target="showframe">frame a</a><br><a href = "marq.html" target="showframe">frame b</a>

Page 17: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

<noframes> tag

• The HTML noframes tag is used (in conjunction with the frameset tag) for specifying alternative content for browsers that don't support frames.

• Syntax:<noframes> </noframes>

Page 18: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

How to use the <noframes> tag

<html> <frameset cols="25%,50%,25%"> <frame src="frame_a.htm"> <frame src="frame_b.htm"> <frame src="frame_c.htm"> <noframes> <body>Your browser does not handle frames!</body> </noframes> </frameset> </html>

Page 19: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

HTML Iframes

• An iframe is used to display a web page within a web page.

Attributes:1. Name-Assigns a name to a frame. This is useful for

loading contents into one frame from another. 2. Longdesc-A long description - this can elaborate on

a shorter description specified with the title attribute.

3. Width-Specifies the width of the inline frame. 4. Height-Specifies the height of the inline frame.

Page 20: FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each

<html><body>

<iframe src="demo_iframe.htm"></iframe>

<p>Some older browsers don't support iframes.</p><p>If they don't, the iframe will not be visible.</p>

</body></html>