HTML Frames
Frames in HTML is used to divide the browser into different sections where each section can load different Html documents. The collection of frames is known as Frameset.
Creating frames: We use frameset instead of the body tag to divide the web page into sections. Rows and Column attributes decide the Horizontal or Vertical Frames.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<html> <head> <title>HTML Frames</title> </head> <frameset rows="50%, 50%"> <frameset cols="25%, 50%,25%"> <frame name="left" src = "/html/top_frame.htm" /> <frame name = "center" src = "/html/ main_frame.htm" /> <frame name = "right" src = "/html/ bottom_frame.htm" /> </frameset> <frameset rows="10%, 80%,10%"> <frame name = "top" src = "/html/top_frame.htm" /> <frame name="main" src = "/html/ main frame.htm" /> <frame name="bottom" src = "/html/ bottom_frame.htm" /> </frameset> </frameset> </html> |
Frameset tag Attribute
- Cols
- Rows
- Border
- Frame Border
- Frame Spacing
HTML IFRAMES
It is similar to the frame tag but it is used to display a Webpage within the Webpage.
Syntax
1 |
<iframe src="URL"> ... </iframe> |
Attributes
Height Width:
1 |
<iframe src="URL" height="200" width="300"></iframe> |
Set or Remove Border:
1 2 |
<iframe src="URL" style="border:2px solid grey;"></iframe> // Set Border. <iframe src="URL" style="border:none;"></iframe> //Remove Border. |
Target:
1 |
<iframe src="URL" name="frame_name"></iframe> |