60 likes | 179 Views
Chapter 8. Frames in HTML. Intro. What are frames: A page can be divided into set of regions each of which can display and present a different page.
E N D
Chapter 8 Frames in HTML
Intro. • What are frames: • A page can be divided into set of regions each of which can display and present a different page. • For example: we can divide a page into 3 different parts. Part one will display a file named for example file1.html, part 2 displays file2.html, and part 3 displays file3.html. • This can be done by frames. • The coordinator file (the one that has the frameset MUST NOT contain <body> tag.
Cont. • To coordinate the individual HTML files, you need a main HTML file telling the browser how many frames and in what orientation they are. <HTML> <TITLE>First Frame Page</TITLE> <FRAMESET COLS="50%,50%"> <FRAME SRC=”left.htm"> <FRAME SRC=”right.htm"> </FRAMESET> </HTML>
Cont. • FRAMESET: starts a frame page • COLS: Set the coming specified frames in columns • FRAME SRC: denotes the source of the frame pages • Similarly, you can have ROWS for horizontal splitting
Cont. • Suppose we have two frames (left frame and right frame). We want to display a page on the right frame upon a click on the left frame (with the <A> command) • We have to set the NAME in the <FRAME> and set the TARGET in the <A> command <HTML> <TITLE>First Frame Page</TITLE> <FRAMESET COLS="50%,50%"> <FRAME NAME=“LEFT” SRC=”left.htm"> <FRAME NAME=“RIGHT” SRC=”right.htm"> </FRAMESET> </HTML> • In the anchor command on the left page, we specify what to display on the RIGHT Frame upon the mouse click: <A HREF="http://www.hkma.org.hk” TARGET=”RIGHT">