Difference between Frame and IFrame

Key Difference: Frame is a HTML tag that is used to divide the web page into various frames/windows. Used as <frame> tag, it specifies each frame within a frameset tag.  Iframe as <iframe> is also a tag used in HTML but it specifies an inline frame which means it is used to embed some other document within the current HTML document.

Both frame and iframe are part of HTML tags. To clarify it further, let us start with the definition of HTML: HTML is a language that is used to create web pages. The coding in the HTML is done through various tags. HTML stands for HyperText Markup Language, and it is a set of markup symbols or codes that are inserted in file and get displayed on a World Wide Web browser page. Frames are used in HTML to divide a browser window into many panes and each pane contains a separate HTML/XHTML document. These tags have different features and different outputs. To start with 'frame', we can define it as a HTML tag that is used for dividing the web page into various frames/windows. It is  used as <frame> tag, each frame can be specified within a frameset tag. Refer to the picture in the left. Here, in this example the window is subdivided into various frames like Banner Frame, Navigation Frame and Content Frame. Each Frame can be linked with a source and three of them may contain three different sources. 

Iframe as <iframe> is also a tag used in HTML but it specifies an inline frame which means it is used to embed some other document within the current HTML document. The frames can be organized in terms of rows and columns.  Frame and iframe, both tags are used to fit several frame windows on a web screen. Frame object represents an HTML frame and IFrame object represents an HTML inline frame. Both have the properties of frame border, height, align, name, scrolling, source, etc. Frames allow several pieces of information to be seen together side by side, but it faced a lot of criticism due to many factors. One of them was that different browsers react differently with frames.

Frame tag is used to divide the page into various windows. For example –

 <frameset cols="25%,25%,25%,25%,">

   <frame src="frame_a.htm">

   <frame src="frame_b.htm">

   <frame src="frame_c.htm">

   <frame src="frame_d.htm">

  </frameset>

This code shows the page with 4 windows. All of them with equal ratio as depicted by the percentage set in <frameset> tag. Each of these four frames can have different attributes like border, scrolling, resize ability, etc.

Iframe tag is used like-

<iframe src="http://www.differencebeetween.info">

  </iframe>

This code shows that in the current page a frame will be shown containing the source URL. So, the source gets embedded within the current page. Netscape browser does not support the iframe tag. Iframes are generally used for showing advertisements in the web page. When we use frame tag then the current page constitutes of only frames whereas in iframe the current web page and the sub window (created by iframe) are treated like two separate entities. It just brings some other source to the current page. The inline frames are also known as floating frames. The World Wide Web Consortium (W3C) included the iframe feature in HTML 4.01.

<frameset> tags were used to create frames with the tag frame whereas iframe fulfills functions of both frame and frameset tags. Unlike frame tags, Iframe tags can also be placed inside the body tags. Placement of iframe is easy, a coder can easily put the tag among the other webpage elements, and also add several iframes if he wants. On the other hand, placing frames in framesets is bit complicated. The coder needs to adjust the frame sizes to display them correctly. Sizing in terms of width is very difficult for frames than in iframes. In frames, the widths of the frames must add up correctly to the width of the web page, whereas in iframe you can just denote the height and width in pixels or in a percentage of the width of the web page and it gets displayed at that particular place in the web page. Summing up the differences in the table below:-

 

Frame

IFrame

Definition

Frame is a HTML tag that is used for dividing the web page into various frames/windows. Used as <frame> tag, it specifies each frame within a frameset tag. 

Iframe as <iframe> is also a tag used in HTML but it specifies an inline frame, that means it is used to embed some other document within the current HTML document.

Tag frameset

Used

Not required

Placement of frames

Comparatively complicated

Easy

Width of frames/panes

Difficult to adjust

Easy to adjust

Image Courtesy: ibm.com, highoncoding.com

Most Searched in Food and Drink Most Searched in Beauty and Style
Most Searched in Home and Garden Top 10 Most Searched Differences
Debit vs ATM Card
Fraternity vs Sorority
Single Birth vs Multiple Births
LG Optimus L7 II Dual vs Sony Xperia J

Comments

Some what I understood....

Hi there, Thank You so much for explanation, it cleared up my confusion. :-)

yo this is goot

Preety Easy to understand for a beginer too.

Nice explanation .. thank you :)

Very good explanation out there with understandable examples!. Thank you.

Add new comment

Plain text

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.