Home > Article > Web Front-end > What is the use of introducing HTML frames (Frames)?
Using Frame, you can display multiple web pages in the browser window at the same time. A web page is set in each Frame, and the web pages in each Frame are independent of each other.
f900b4fc197b16ab214eecf015bb6bd2eb5f059992a0ae0ef16884cb75644e40Determines how to divide the Frame. f900b4fc197b16ab214eecf015bb6bd2 has cols attributes and rows attributes. Use the cols attribute to distribute the Frame by columns; use the rows attribute to distribute the Frame by rows.
Use the 04a0d55efbbfd646a993fbc01f262c57 tag to set the web page. There is a src attribute in 04a0d55efbbfd646a993fbc01f262c57, and the src value is the path and file name of the web page.
The purpose of the following code is to divide the Frameset into 2 columns. The first column is 25%, which means the width of the first column is 25% of the window width; the second column is 75%, which means the width of the first column. is 75% of the window width. a.html is displayed in the first column and b.html is displayed in the second column.
<frameset cols="25%,75%"> <frame src="../asdocs/html_tutorials/Frame_a.html"> <frame src="../asdocs/html_tutorials/Frame_b.html"> </frameset>
Iframe means Inline Frame. Use d5ba1642137c3f32f4f4493ae923989c065276f04003e4622c4fe6b64f465b88 to place the Frame within an HTML file.
<html> <frameset cols="25%,50%,25%"> <frame src="../asdocs/html_tutorials/Frame_a.html"> <frame src="../asdocs/html_tutorials/Frame_b.html"> <frame src="../asdocs/html_tutorials/Frame_c.html"> </frameset> </html>
This example shows how to display three web pages at the same time in the browser. The three web pages are distributed in columns.
<html> <frameset rows="25%,50%,25%"> <frame src="../asdocs/html_tutorials/Frame_a.html"> <frame src="../asdocs/html_tutorials/Frame_b.html"> <frame src="../asdocs/html_tutorials/Frame_c.html"> </frameset> </html>
This example shows how to display three web pages at the same time in the browser. The three web pages are distributed in rows.
Mixed Frameset
<html> <frameset rows="50%,50%"> <frame src="../asdocs/html_tutorials/Frame_a.html"> <frameset cols="25%,75%"> <frame src="../asdocs/html_tutorials/Frame_b.html"> <frame src="../asdocs/html_tutorials/Frame_c.html"> </frameset> </frameset> </html>
This example uses both the cols attribute and the rows attribute to flexibly distribute the Frame.
The noresize attribute in Frameset
<html> <frameset rows="50%,50%"> <frame noresize="noresize" src="../asdocs/html_tutorials/Frame_a.html"> <frameset cols="25%,75%"> <frame noresize="noresize" src="../asdocs/html_tutorials/Frame_b.html"> <frame noresize="noresize" src="../asdocs/html_tutorials/Frame_c.html"> </frameset> </frameset> </html>
Use the Noresize attribute to ensure the size of the Frame. If the noresize attribute is not used, you can use the mouse to move the border of the Frame to change the size of the Frame. If the noresize attribute is set, the border cannot be moved.
Frame for navigation
<html> <frameset cols="120,*"> <frame src="../asdocs/html_tutorials/framelist.html"> <frame src="../asdocs/html_tutorials/Frame_a.html" name="showframe"> </frameset> </html>
This example demonstrates how to create a Frame for navigation. This navigation Frame contains an HTML, and this HTML (code below) contains a list of web pages. Click on any item in the web page list, and the clicked web page will be displayed in the second Frame.
<HTML> <HEAD> <TITLE> humorlist.html </TITLE> </HEAD> <BODY> <p><a href = "../asdocs/html_tutorials/Frame_a.html" target="showframe">笑话一<a></p> <p><a href = "../asdocs/html_tutorials/Frame_b.html" target="showframe">笑话二<a></p> <p><a href = "../asdocs/html_tutorials/Frame_c.html" target="showframe">笑话三<a></p> </BODY> </HTML>
Usage of Iframe
<html> <body> <p>用 IFRAME 可以在HTML文件里显示另一个网页。</p> <p>这个 HTML 文档中使用 IFRAME 来显示另外一个叫Frame_a.html 的网页。</p> <iframe src="../asdocs/html_tutorials/Frame_a.html"></iframe> </body> </html>
This example shows how to use iframe to embed a web page in an HTML file.
The above is the detailed content of What is the use of introducing HTML frames (Frames)?. For more information, please follow other related articles on the PHP Chinese website!