frames. frames allow you to divide the page into several rectangular areas and to display a separate...

24
FRAMES

Upload: maude-arnold

Post on 17-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

FRAMES

Page 2: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

Frames allow you to divide the page into several rectangular

areas and to display a separate document in each rectangle. Each of those rectangles is

called a "frame".

Page 3: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

Name: Password: What kind of shirt are you wearing? Shade: Dark Light Size: Small Medium Large Select your favorite cartoon characters. Goofy Donald Bugs Bunny Scooby Doo College Degree? Musical Taste

Page 4: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

Think of frames as creating a "table of documents" on the page. Like a table, a group of frames has rows and columns. Each cell of the table contains a document which is stored in a separate file.

<FRAMESET ...> defines the beginning and end of the table, and how many rows and columns that table will have. <FRAME ...> defines what will go into each cell ("frame") of the table.

Page 5: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles
Page 6: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

<HTML> <HEAD> <TITLE>A Basic Example of Frames</TITLE> </HEAD>

<FRAMESET ROWS="75%,25%" COLS=“60%,40%">

<FRAME SRC="framea.html"> <FRAME SRC="frameb.html"> <FRAME SRC="framec.html"> <FRAME SRC="framed.html">

</FRAMESET> </HTML>

Page 7: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

<FRAMESET > Start the "table of documents".

ROWS="75%, *" The table should have two rows. The first row should take up 75% of the height of the page, the

second should take up the rest.

COLS="*, 40%"> The table should also have two columns. The second column should take up 40% of the width of the

page, the first column should take up the rest.

<FRAME SRC="framea.html"><FRAME SRC="frameb.html"><FRAME SRC="framec.html"><FRAME SRC="framed.html">

Put the four files into the frames.

<NOFRAMES> ... </NOFRAMES> Every framed page should have a no-frames alternative. The <NOFRAMES> content should go

inside the outermost <FRAMESET ...> tag, usually just before the last </FRAMESET>. The most efficicent method for no-frames content is to link to a page which is specifically designed for no-frames.

</FRAMESET> End the frameset.

There are several other aspects of frames to note from this example:

Page 8: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

•src="address" (Frame)

Specifies the address of the document to be displayed in the frame.

•name="window_name" (frame)

The NAME attribute is used to assign a name to a frame so it can be targeted by links in other documents.

ATTRIBUTES OF FRAMESET AND FRAME TAGS

Page 9: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

frameborder="1|0" (frameset) When set to "1" a separator is drawn on every

side next to another frame. When set to "0" the decision to draw separators is left to surrounding frames.

Page 10: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

marginwidth="value" (frame)The MARGINWIDTH attribute is used to control

the left and right margins. The value for MARGINWIDTH is in pixels. This insures that frame objects won't touch frame edges

marginheight="value"

It controls the upper and lower margins.

Page 11: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

noresize (frame) The NORESIZE attribute doesn't require a

value. It is used to indicate that the frame is not resizable by the user.

The NORESIZE attribute is optional; by default all frames are resizable.

Page 12: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

scrolling="yes|no|auto" (frame) The SCROLLING attribute indicates whether

the frame should have scrollbars or not. "yes" results in scrollbars always being visible

on that frame. "no" results in scrollbars never being visible. "auto" instructs the browser to decide whether

scrollbars are needed, and to place them where necessary.

Page 13: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

Framespacing =“value” (frameset)

To increase the space between adjacent frames.

Page 14: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

NESTED FRAME

Page 15: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

Name: Password: What kind of shirt are you wearing? Shade: Dark Light Size: Small Medium Large Select your favorite cartoon characters. Goofy Donald Bugs Bunny Scooby Doo College Degree? Musical Taste

Page 16: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles
Page 17: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

<Frameset cols=“30%,70%”>

Page 18: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

<HTML> <HEAD> <TITLE>Great Recipes</TITLE> </HEAD>

<FRAMESET ROWS="15%,85%"> <FRAME SRC=“address1" SCROLLING=NO>

<FRAMESET COLS="20%,80%"> <FRAME SRC=“address2"> <FRAME SRC=“address3"></FRAMESET>

</FRAMESET>

Page 19: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles
Page 20: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

The first <FRAMESET ...> tag says "this frameset will have two rows".

The first <FRAME ...> tag puts a document in the first frame.

The second frame is filled in not by a document but by another frameset. The second <FRAMESET ...> is creating a "table within a table", or, to be more correct, a frameset within a frameset.

Page 21: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

Links in a frame

Page 22: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles
Page 23: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

Source code for the linked page

<A HREF=“link.HTML" TARGET=c>CONTENTS</A>

<frameset rows=15%,85%>

<frame src="title.HTML" NAME=a>

<frameset COLS=20%,80%>

<frame src=“sidemenu.HTML" name=b>

<frame src="MAIN.HTML" name=c>

</frameset>

</frameset>

Page 24: FRAMES. Frames allow you to divide the page into several rectangular areas and to display a separate document in each rectangle. Each of those rectangles

Targeting the Whole Window Eventually in a framed site you want to "break out"... link to a page and

have that page take over the entire window. To create this sort of link, we add TARGET="_top" to the <A ...> tag:

this codeproduces this<A HREF="wwtarget.html" TARGET="_top"> the link in this page

In the previous example we used TARGET to refer to a frame we had named MAIN. In this example, however, we refer to a frame we never named: "_top". We can do this because the outermost frame (that is, the entire window) is already named "_top". "_top" is a reserved name which is automatically given to the entire window. So when we say TARGET="_top", we are saying "put the new web page in the entire window". Note that "_top" needs to be in all lower-case, it should have quotes around it, and don't forget the underscore ("_").

TARGET=NAME OF THE DOCUMENT,