HTML Frames

In this tutorial you will learn about the HTML Frames and its application with practical example.

HTML Frames gives us a way to merge multiple HTML Documents in a single HTML Document. HTML Frames splits the browser window into multiple panes or rectangular sections, each pane can contain separate HTML Document.This division process is same as for the HTML Table.

HTML Frameset (<frameset>) element is used instead of HTML Body (<body>) tag to split the browser screen into multiple pane, and each pane is defined by HTML Frame (<frame>) element.

Example:

Output:

HTML Frameset Attributes

Attribute Description
cols This attribute specifies the number of columns in frameset along with their width separated by the comma.Width can be specified in percentage or pixels
rows This attribute specifies the number of rows in frameset along with their height separated by the comma.Height can be specified in percentage or pixels
border This attribute specifies the width of the border for the frames. Value “0” means no border.

Example-1:

Output:

col 1, row 1 col 2
col 1, row 2

Example-2:

Output:

row 1, col 1 row 1, col 2
row 2

HTML Frame Attributes

Attribute Description
src This attribute specifies URL of the source HTML Document. This can be absolute or relative path.
frameborder This attribute specifies whether or not the frame border shown. Possible values either 1 (yes) or 0 (no).
noresize This attribute specifies whether or not user will be able to resize the frame.
scrolling This attribute specifies whether or not scrollbars will appear for the frame.

Inline Frames – The HTML <iframe> Element:

We can create an inline frame within the HTML Document using the <iframe> tag. HTML <iframe> gives us a way to call HTML Document inside another HTML Document.HTML <iframe> element defines a rectangular region inside the HTML document in that region browser will render a separate HTML document, including scrollbars and borders.

Attribute Description
src This attribute specifies URL of the source HTML Document. This can be absolute or relative path.
width This attribute specifies frame width.Width can be specified in percentage or pixels.
Height This attribute specifies frame height.Height can be specified in percentage or pixels.
frameborder This attribute specifies whether or not the frame border shown. Possible values either 1 (yes) or 0 (no).
scrolling This attribute specifies whether or not scrollbars will appear for the frame.

In this tutorial we have learn about the HTML Frames and its application with practical example. I hope you will like this tutorial.