html_frames.asp@output=print
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML Frames</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />
<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</head>
<body>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
<h1>HTML Frames</h1>
<a href="html_links.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="html_tables.asp"><img border="0" src="../images/btn_next.gif" width="100" height="20" alt="Next" /></a>
<hr />
<p class="intro">With frames, you can display more than one Web page in the same
browser window.</p>
<hr />
<h2>Examples</h2>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_frame_cols">Vertical frameset</a><br />
This example demonstrates how to make a vertical frameset with three different
documents.
</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_frame_rows">Horizontal frameset</a><br />
This example demonstrates how to make a horizontal frameset with three different
documents.</p>
<p>(You can find more examples at the bottom of this page)</p>
<hr />
<h2>Frames</h2>
<p>With frames, you can display more than one HTML document in the same browser
window. Each HTML document is called a frame, and each frame is independent of
the others.</p>
<p>The disadvantages of using frames are:</p>
<ul>
<li>The web developer must keep track of more HTML documents</li>
<li>It is difficult to print the entire page</li>
</ul>
<hr />
<h2>The Frameset Tag</h2>
<ul>
<li>The <frameset> tag defines how to divide the window into frames</li>
<li> Each frameset defines a set of rows <b> or</b> columns</li>
<li>The values of the rows/columns indicate the amount of screen area each row/column will
occupy</li>
</ul>
<hr />
<h2>The Frame Tag</h2>
<ul>
<li>The <frame> tag defines what HTML document to put into each frame</li>
</ul>
<p>In the example below we have a frameset with two columns. The first column is
set to 25% of the width of the browser window. The second column is set to 75%
of the width of the browser window. The HTML document "frame_a.htm" is
put into the first column, and the HTML document "frame_b.htm" is put
into the second column:</p>
<table width="100%" class="ex" cellspacing="0" border="1">
<tr>
<td>
<pre><frameset cols="25%,75%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
</frameset></pre>
</td>
</tr>
</table>
<p><b>Note:</b> The frameset column size value can also be set in pixels
(cols="200,500"), and one of the columns can be set to use the remaining space
(cols="25%,*").<br />
</p>
<hr />
<h2>Basic Notes - Useful Tips</h2>
<p>If a frame has visible borders, the user can resize it by dragging
the border. To prevent a user from doing this, you can add noresize="noresize" to
the <frame> tag.</p>
<p>Add the <noframes> tag for browsers that do not
support frames.</p>
<p><b>Important:</b> You cannot use the <body></body> tags together with the
<frameset></frameset> tags! However, if you add a <noframes> tag containing some
text for browsers that do not support frames, you will have to enclose the text
in <body></body> tags! See how it is done in the first example below.</p>
<hr />
<h2>More Examples</h2>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_noframes">How to use the <noframes> tag</a><br />
This example demonstrates how to use the <noframes> tag.
</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_frame_mix">Mixed frameset</a><br />
This example demonstrates how to make a frameset with three documents, and
how to mix them in rows and columns.
</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_frame_noresize">Frameset with noresize="noresize"</a><br />
This example demonstrates the noresize attribute. The frames are not resizable.
Move the mouse over the borders between the frames and notice that you can not
move the borders.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_frame_navigation">Navigation frame</a><br />
This example demonstrates how to make a navigation frame. The navigation frame contains a
list of links with the second frame as the target. The file called "tryhtml_contents.htm"
contains three links. The source code of the links:<br />
<a href ="frame_a.htm" target ="showframe">Frame a</a><br><br />
<a href ="frame_b.htm" target ="showframe">Frame b</a><br><br />
<a href ="frame_c.htm" target ="showframe">Frame c</a><br />
The second frame will show the linked document.</p>
<p>
<a target="_blank" href="tryit.asp@filename=tryhtml_iframe">Inline frame</a><br />
This example demonstrates how to create an inline frame (a frame inside an HTML
page).
</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_frame_jump">Jump to a specified section
within a frame</a><br />
This example demonstrates two frames. One of the frames has a source to a
specified section in a file. The specified section is made with <a
name="C10"> in the "link.htm" file.
</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_frame_navigation2">Jump to a specified
section with frame navigation</a><br />
This example demonstrates two frames. The navigation frame (content.htm) to the left contains a
list of links with the second frame (link.htm) as a target. The second frame shows
the linked document. One of the links in the navigation frame is linked to a
specified section in the target file. The HTML code in the file "content.htm"
looks like this: <a href ="link.htm" target ="showframe">Link without Anchor</a><br><a href
="link.htm#C10" target ="showframe">Link with Anchor</a>.
</p>
<hr />
<h2>Frame Tags</h2>
<table class="ex" cellspacing="0" border="1" width="100%">
<tr>
<th align="left">Tag</th>
<th align="left">Description</th>
</tr>
<tr>
<td><a href="../tags/tag_frameset.asp"><frameset></a></td>
<td> Defines a set of frames</td>
</tr>
<tr>
<td><a href="../tags/tag_frame.asp"><frame></a></td>
<td> Defines a sub window (a frame)</td>
</tr>
<tr>
<td><a href="../tags/tag_noframes.asp"><noframes></a></td>
<td>Defines a noframe section for browsers that do not handle frames</td>
</tr>
<tr>
<td><a href="../tags/tag_iframe.asp"><iframe></a></td>
<td>Defines an inline sub window (frame)</td>
</tr>
</table>
<br />
<hr />
<a href="html_links.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="html_tables.asp"><img border="0" src="../images/btn_next.gif" width="100" height="20" alt="Next" /></a>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -