search
HomeWeb Front-endHTML TutorialThe difference between frame and iframe tags

The difference between frame and iframe tags

May 11, 2018 pm 05:41 PM
frameiframethe differenceLabel

1. Frame cannot be used alone without frameSet, iframe can;

2. Frame cannot be placed in body; it can be displayed normally as follows:

<!--<body>--> 
<frameset rows="50%,*"> 
   <frame   name="frame1"   src="test1.htm"/>  
   <frame   name="frame2"   src="test2.htm"/>  
</frameset> 
<!--<body>-->

The following cannot be displayed normally:
##

<body> 
<frameset rows="50%,*"> 
   <frame   name="frame1"   src="test1.htm"/>  
   <frame   name="frame2"   src="test2.htm"/>  
</frameset> 
<body>

3. Nested in frameSet The iframe must be placed in the body; the following can be displayed normally:

<body> 
    <frameset>  
      <iframe   name="frame1"   src="test1.htm"/>  
      <iframe   name="frame2"   src="test2.htm"/>  
    </frameset>  
  </body>

The following cannot be displayed normally:

 <!--<body>--> 
    <frameset>  
      <iframe   name="frame1"   src="test1.htm"/>  
      <iframe   name="frame2"   src="test2.htm"/>  
    </frameset>  
  <!--</body>-->

4. iframes that are not nested in frameSet can be used at will;
The following can be displayed normally:

<body> 
   <iframe   name="frame1"   src="test1.htm"/>  
   <iframe   name="frame2"   src="test2.htm"/>  
</body> 
<!--<body>--> 
   <iframe   name="frame1"   src="test1.htm"/>  
   <iframe   name="frame2"   src="test2.htm"/>  
<!--</body>-->

5. The height of the frame can only be controlled through frameSet; iframe can be controlled by itself, not through frameSet, such as:

<!--<body>--> 
<frameset rows="50%,*"> 
   <frame   name="frame1"   src="test1.htm"/>  
   <frame   name="frame2"   src="test2.htm"/>  
</frameset> 
<!--</body>--> 
<body> 
<frameset> 
   <iframe height="30%"  name="frame1"   src="test1.htm"/>  
   <iframe height="100"  name="frame2"   src="test2.htm"/>  
</frameset> 
</body>

6 . If more than two iframes are used on the same page, it can be displayed normally in IE, but only the first one can be displayed in Firefox; if more than two iframes are used, it can be displayed normally in both IE and Firefox
The above code was tested in IE7 and firefox2.0.
In addition, theft summary from related forums :-)
1 Frame and Iframe can achieve basically the same functions, but Iframe has more flexibility than Frame.
frame is the frame of the entire page, iframe is an embedded web page element, which can also be said to be an embedded frame
The Iframe tag is also called floatingFrame tag, you can use it to embed a HTML document in an HTML display. The biggest difference between it and the Frame tag is that the content contained in embedded in the web page is an integral part of the entire page, while the content contained in is an independent Individuals can be displayed independently. In addition, using Iframe can also display the same content multiple times on the same page without having to repeat the code of this content.
2iframe can be placed in form. frame does not work.

<table> 
<tr> 
<td><iframe id="" src=""></iframe></td><td></td> 
</tr> 
</table>

3frame必须在frameset里 
而frameset不能与body元素共存,也就说有frameset元素的文档只能是一个框架集,不能有别的东东 
4IFrame是放在网业的什么地方都行   
  但是frame只能放到上下左右四个方向 
5iframme   是活动帧   
  而frame是非活动帧   
  iframe使用方法如下   
   
iframe用起来更灵活,不需要frame那么多讲究   
而且放的位置也可以自己设 
iframe是内嵌的,比较灵活,不过也有不好的地方,就是位置在不同的浏览器和分辨率下有可能不同,有时会把本来好好的页面搞得变形 
iframe就没有这个限制 
6iframe   可以加在网页中任何一个地方。   
  而frame   通常做框架页 
iframe是一个网页中的子框架,两网页间是父子关系   
  frame是框架,由多个并列的网页构成 
楼上的说得对,iframe是浮动的。就像是浮动面板,而frame是固定的。只能四个方向上的。   
你可以直接在网页里用一下,看看效果就行了。 
7
iframe   更利于版面的设计   
  frame     一条直一条竖的不美观 
frame的那一条线也可以去掉的呦!只不过,iframe更方便对其进行数据的交换吧! 
iframe可以放置到你想放的任意位置,控制起来比frame方便 
8iframe是内部帧,可以嵌在一个页面里面,设置内部帧的属性可以使得整体看上去象一个完整的页面,而不是由多个页面组成,frame有frame的好处,比如何多网站,上面放广告条,左边放菜单,右边放内容,这样上边和左边的内容都可不动,只刷新右边页面的内容,选择iframe还是frame完全看自己的需求。 
说白了,用IFrame比用Frame少一个文件(FrameSet),但支持Frame的浏览器比较多。 
The entire website I made for my company uses iframes, which are not supported by Linux browsers. Oops, it’s ugly, but I still like to use iframes
There are also iframes available Put it in the table, and then set ifame to width=100% height=100%
I can just modify the width and height of my table, which is beneficial to typesetting
In fact, Frame is a control
The usage method is the same as Panle.
frame is a page that divides a web page into multiple pages. It needs to have a frameset page frameset
iframe is a floating frame, which is to add another page to your page,
use To cut the page horizontally or vertically,

Frame is generally used to set Page layout, divide the entire page into regular blocks, each block contains a new page.
iframe is used to insert a new page anywhere on the page.
Therefore, Frame is used to control the page format. For example, in a book, the chapter table of contents is on the left and the text is on the right. The text is very long and you need to drag it when reading, but you don’t want the table of contents to be dragged too. No more. Therefore, it is best to use Frame to divide the page into 2 regular pages, one left and one right.
And iframe is more flexible and does not require dividing the entire page. You can use it anywhere on the page iframe embeds new page.

The above is the detailed content of The difference between frame and iframe tags. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How do you insert an image into an HTML page?How do you insert an image into an HTML page?May 04, 2025 am 12:02 AM

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

HTML's Purpose: Enabling Web Browsers to Display ContentHTML's Purpose: Enabling Web Browsers to Display ContentMay 03, 2025 am 12:03 AM

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

Why are HTML tags important for web development?Why are HTML tags important for web development?May 02, 2025 am 12:03 AM

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

Explain the importance of using consistent coding style for HTML tags and attributes.Explain the importance of using consistent coding style for HTML tags and attributes.May 01, 2025 am 12:01 AM

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

How to implement multi-project carousel in Bootstrap 4?How to implement multi-project carousel in Bootstrap 4?Apr 30, 2025 pm 03:24 PM

Solution to implement multi-project carousel in Bootstrap4 Implementing multi-project carousel in Bootstrap4 is not an easy task. Although Bootstrap...

How does deepseek official website achieve the effect of penetrating mouse scroll event?How does deepseek official website achieve the effect of penetrating mouse scroll event?Apr 30, 2025 pm 03:21 PM

How to achieve the effect of mouse scrolling event penetration? When we browse the web, we often encounter some special interaction designs. For example, on deepseek official website, �...

How to modify the playback control style of HTML videoHow to modify the playback control style of HTML videoApr 30, 2025 pm 03:18 PM

The default playback control style of HTML video cannot be modified directly through CSS. 1. Create custom controls using JavaScript. 2. Beautify these controls through CSS. 3. Consider compatibility, user experience and performance, using libraries such as Video.js or Plyr can simplify the process.

What problems will be caused by using native select on your phone?What problems will be caused by using native select on your phone?Apr 30, 2025 pm 03:15 PM

Potential problems with using native select on mobile phones When developing mobile applications, we often encounter the need for selecting boxes. Normally, developers...

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.