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.



<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 a Webpage within the Webpage.


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


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.


<iframe src="URL" name="frame_name"></iframe>
Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy