HTML Frames

Frames in Html is used to divide the browser into different sections where each section can load different Html documents. Collection of frame is known as Frameset.

Creating frames:We use frameset instead of body tag to divide web page into sections. Rows and Column attributes decide the Horizontal or Vertical Frames

<title>HTML Frames</title>  
<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 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 tag Attribute

  • Cols
  • Rows
  • Border
  • Frame Border
  • Frame Spacing


It is similar to the frame tag but it is used to display “Webpage within the Webpage. 


<iframe src="URL"> ... </iframe>


  • Set Height Width: <iframe src="URL" height="200" width="300"></iframe>
  • Set or Remove Border: <iframe src="URL" style="border:2px solid grey;"></iframe> //Set Border.
    <iframe src="URL" style="border:none;"></iframe> //Remove Border.
  • Target: <iframe src="URL" name="frame_name"></iframe>