60 likes | 233 Views
what.html. WHAT. are.html. frames.html. frames?. are. Intro to Frames. HTML frames allow you to display more than 1 HTML document in the same browser window. Every HTML document is called a frame and each frame is independent. There are some disadvantages of using frames:
E N D
what.html WHAT are.html frames.html frames? are
Intro to Frames • HTML frames allow you to display more than 1 HTML document in the same browser window. Every HTML document is called a frame and each frame is independent. • There are some disadvantages of using frames: • you must keep track of more HTML documents • difficult to print the entire page • Components of HTML Frames: • Frameset element • The frameset element states HOW MANY columns or rows there will be in the frameset, and HOW MUCH percentage/pixels of space will occupy each of them. • Frame element • The <frame> tag defines one particular window (frame) within a frameset.
Arranging Frames • Vertical Frameset: • Creates frames arranged in columns • Example: • <frameset cols=“20%,80%"> <frame src="frame1.html" /> <frame src="frame2.html" /></frameset> • Horizontal Frameset: • Creates frames arranged in rows • Example: • <frameset rows=“50%,50%"> • <frame src="frameA.html" /> • <frame src="frameB.html" /> • </frameset>
Arranging Frames cont. • Mixed Frameset: • Creates frames arranged in columns & rows • <html><frameset rows="25%,75%"><frame src="frameA.html"><frameset cols=“70%,30%"><frame src="frameB.html"><frame src="frameC.html"></frameset></frameset></html> frameA.html: height-25% frameC.html:width-30%height-75% frameB.html:height-75%width-25% • Notes about HTML Frames: • The frameset column or row size can also be set in pixels such as cols=“100,600“ • One of the columns or rows can be set to use the remaining space of the browser window, with an asterisk (cols=“33%,*") • You can not use the <body></body> tags together with the <frameset></frameset> tags!
Arranging Frames cont. • iFrames: • Creates an inline frame (a frame inside an HTML page). • <iframe src=“test.html"> • </iframe> • height=“any number” & width=“any number” can be added to the <iframe src…> tag to set the size of the iframe • Frame borders can be removed by adding the frameborder=“0” to either the <frameset…> or <iframe …> tag • Buttons or hyperlinks can be directed to open pages in specific frames by adding: name=“any name” to the <iframe…> or <frame src…> tag and adding: target=“same name” to the <a href…> tag of the button or hyperlink. • To remove the ability for the user to resize the frames the noresize=“noresize” can be added to the <frame src…> tag.
Frames: Review HTML frames allow you to display more than 1 HTML document in the same browser window in the following ways: Horizontal Frameset Vertical Frameset Mixed Frameset iFrame • Frame sizes can be set using percentages or pixels • Asterisks = fill the rest of the browser window • <body> tags can not used with the <frameset> tags • Buttons can open pages in specific frames by naming the frame and setting the target with the same name