framesetf900b4fc197b16ab214eecf015bb6bd2eb5f059992a0ae0ef16884cb75644e40决定如何划分frame。f900b4fc197b16ab214eecf015bb6bd2有cols属性和rows属性。使用cols属性,表示按列分布frame;使用rows属性,表示按行分布frame。
frame用04a0d55efbbfd646a993fbc01f262c57这个tag设定网页。04a0d55efbbfd646a993fbc01f262c57里有src属性,src值就是网页的路径和文件名。
下面的代码的目的是:将frameset分成2列,第一列25%,表示第一列的宽度是窗口宽度的25%;第二列75%,表示第一列的宽度是窗口宽度的75%。第一列中显示a.html,第二列中显示b.html。
<frameset cols="25%,75%"> <frame src="../asdocs/html_tutorials/frame_a.html"> <frame src="../asdocs/html_tutorials/frame_b.html"> </frameset>
iframeiframe是inline frame的意思,用<iframe></iframe>可以将frame置于一个html文件内。
示例<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>
这个例子显示如何在浏览器里同时显示三个网页,三个网页是按列分布的。
<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>
这个例子显示如何在浏览器里同时显示三个网页,三个网页是按行分布的。
混合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>
这个例子既用到了cols属性,又用到了rows属性,将frame进行灵活分布。
frameset中的noresize属性
<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>
使用noresize属性可以确保frame的大小。如果不使用noresize属性,你可以用鼠标移动frame的边界,来改变frame的大小,如果设置了noresize属性,就不能移动边界了。
frame用于导航
<html> <frameset cols="120,*"> <frame src="../asdocs/html_tutorials/framelist.html"> <frame src="../asdocs/html_tutorials/frame_a.html" name="showframe"> </frameset> </html>
这个例子演示如何建立一个用于导航的frame。这个导航frame包含一个html,这个html(代码如下)包含了一个网页列表。点击网页列表中的任何一项,就会在第二个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>
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>
这个例子显示如何在一个html文件里用iframe嵌入一个网页。
以上就是 介绍html框架(frames)到底有什么用?的详细内容。