Download presentation
Published byVictoria Maxwell Modified over 9 years ago
1
HTML FRAMES With Frames, you can display more than one Web page in the same browser window.
2
FRAMES Each HTML document is called a frame, and each frame is independent of the others. The disadvantages of using frames are: The Web developer must keep track HTML documents It is difficult to print the entire page.
3
THE FRAMESET TAG The <frameset> tag defines how to divide the window into frames Each frameset defines a set of rows or columns The values of the rows/columns indicate the amount of screen area each row/column will occupy <frameset cols=“25%”,”75%”> <frame src=“frame_a.htm”> <frame src=“frame_b.htm”> </frameset>
4
THE FRAME TAG The <frame> tag defines what HTML document to put into each frame. In the example below we have a frameset with two columns. The first column is set to 25% of the width of the browser window. The second column is set to 75% of the width of the browser window. The HTML document document “frame_a.htm” is put into the first column, and the HTML document “frame_b.htm” is put into the second column. <frameset cols=“25%”,”75%”> <frame src=“frame_a.htm”> <frame src=“frame_b.htm”> </frameset>
5
BASIC NOTES-USEFUL TIPS
If a frame has visible borders, the user can resize it by dragging the border. To prevent a user from doing this, you can add noresize=“noresize” to the <frame> tag. Add the <no frames> tag for browser that do not support frames. You cannot use the <body></body> tags together with the <frameset></frameset> tags. However, if you will add <noframes> tag for browser that do not support frames, you will enclose the text in <body></body> tags.
6
FRAME TAGS Defines an inline sub window (frame) <iframe>
Defines a noframe section for browsers that do not handle frames. <noframes> Defines a sub window (a frame) <frame> Defines a set of frames <frameset> Description Tag
7
Frame and Tag Attributes
Sample: <html> <head> <title> Hello, World! </title> </head> <frameset cols=“150,150” frameborder=“YES” frame spacing=“5” bordercolor=“0099ff”> <frame name=“leftframe” scrolling=“NO” noresize src=“menu.html”> <frame name=“right frame” scr=“mainpage.html”> </frameset> </html>
8
Frameset Attributes Explained
Cols=“150,150” – it tells the browser to create columns <vertical setup) of 2. The left column’s width is 150 pixels, while the other is 850 pixels. Frameborder=No or Yes – defines whether to make the frameborder dividing the windows become visible or not. border-=“n” – when the value for frameborder is YES, you can set the thickness of the border in pixels by entering a number to the value. Framespacing=“n” – defines the spacing between the 2 framesets in the window. The expected value here is a number. Bordercolor=“rrggbb” – applies color to the border when it is turned on. Replace “rrggbb” with hexadecimal color value. Name=“anyname” – assigns a name to the frame on the left (if vertical) or top frame (if horizontal) in the frameset definition.
9
Frameset Attributes Explained
Noresise – tells the browser to lock the border. Scrolling=“YES or NO” – controls whether the scrollbar is turned on or not. The default is NO. When turned on, and if the page of the document is long, the scrollbar will become visible. Scr=“file.html” – the document you’re calling to load in the window. SRC is short for source file.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.