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.

<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

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

Attributes

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>
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