IFRAME and Frameset

Source: Internet
Author: User

Frameset setting one or more frames in a page cannot be nested inside the body tag

Frameset It is called the frame tag, is used to tell the HTML file is the frame mode, and to set the visual window how to Split

Fram It just sets a parameter property in a frame window

IFrame It is a frame window embedded in a page

Properties of the Frameset

1, cols It is to divide the entire picture vertically into several pictures
2. Rows It is to divide the entire picture into several pictures
3. frameborder It means setting the frame's border value. Its value is only two 0 or 1.0 means the border is not displayed, and 1 indicates the border is displayed.
4, border It represents the width of the border
5, BorderColor It is set the color of the frame border

Properties of Frame

1. SRC refers to the link of the webpage file to be displayed in this frame window
2. Name refers to this frame window
3. Framespacing refers to the distance between the frame and the frame that is left blank
4, scrlling refers to whether the frame window to display scroll bar
6, noresize refers to the size of the frame can not be arbitrarily dragged, change the size
7, marginheight refers to the size of the space reserved by the top and bottom edges of the frame
8. Marginwidth refers to the size of the space reserved by the left and right edges of the frame.

Frameset and frame tags must be used together

Frame has an important value of target, which indicates that the Web page is opened in the specified frame

And Target has a value of four.

1. Blank it means to open the linked page in a new window

2, top it means to open the linked page in this window

3. Parent opens a linked page in the previous layer's frame

4. Self opens a linked page in a hyperlink

Target is something you'll definitely use when you're writing a navigation.

Noframes means that when the browser completely does not show the frame, the page will display the contents of <noframes></noframes>.

Properties of the IFRAME

1. Name is the names of the frame windows
2. Align is the way in which the contents of the frame window are
3, Width is the width of the frame window, the unit is pixels
4, height is the length of the frame window, the unit is pixels
5. Marginwidth is the space reserved for the inserted file and the left and right edges of the frame
6. Marginheight is the space reserved for the inserted file and the top and bottom edge of the frame
7, frameborder refers to whether the border is displayed. 1 indicates a border is displayed, 0 means no border is displayed
8, scrolling is whether to allow the use of scroll bars.

Using frameset and frame, you can make a Web page into a different size frame that you want to use for layout.

IFRAME is to embed some Web pages in the current page, to achieve the desired effect.

The difference between frame and IFRAME

1, frame can not be separated from frameset alone, IFRAME May;

2, frame can not be placed in the body, as shown below:

<!--<body>-->
<frameset rows= "50%,*" >
<frame name= "Frame1"
src= "Test1.htm"/>
<frame name= "Frame2"
src= "Test2.htm"/>
</frameset>
<!--<body>-->

The following does not display properly:

<body>
<frameset rows= "50%,*" >
<frame name= "Frame1"
src= "Test1.htm"/>
<frame name= "Frame2"
src= "Test2.htm"/>
</frameset>
<body>

3, nested in the frameset of the IFRAME must be placed in the body, the following can be displayed as normal:

<body>
<frameset>
<iframe name= "Frame1"
src= "Test1.htm"/>
<iframe name= "Frame2"
src= "Test2.htm"/>
</frameset>
</body>

The following does not display properly:

<!--<body>-->
<frameset>
<iframe name= "Frame1"
src= "Test1.htm"/>
<iframe name= "Frame2"
src= "Test2.htm"/>
</frameset>
<!--</body>-->

4, not nested in the frameset of the IFRAME can be used freely;
The following can be displayed as normal:

<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, frame height can only be controlled by frameset, IFrame can control itself, not through frameset control, 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 the same page using more than two iframe, in IE can display normally, in Firefox can only show the first; use more than two frame in IE and Firefox can be normal

The above code is tested in IE7 and firefox2.0.

IFRAME and Frameset

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.