Home > Web Front-end > HTML Tutorial > How to use html frameset tag? Detailed explanation of html frameset tag attributes

How to use html frameset tag? Detailed explanation of html frameset tag attributes

寻∝梦
Release: 2018-08-17 13:41:10
Original
5151 people have browsed it

html How to use frameset tag? Detailed explanation of the attributes of the html frameset tag. This article mainly describes the definition and usage of the html frameset tag, as well as the uses of the two attributes of the html frameset tag (with examples)

First of all, let us understand what html frameset is. Tag:

html Definition and usage of frameset tag:

frameset element can define a frameset. It is used to organize multiple windows (frames). Each framework has separate documentation. In its simplest application, the frameset element simply specifies how many columns or rows exist in the frameset. You must use cols or rows attributes.

html The role of the frameset tag:

Its role is to specify a frameset for organizing multiple frames and nested framesets.

The FRAMESET element is a container for FRAME elements. An HTML document can contain either a FRAMESET element or a BODY element, but not both.

If a user opens a Web folder in a frame and then clicks something in the Web folder, the clicked file or folder will replace the entire window. For example, suppose a page contains two frames, one pointing to a URL and the second pointing to a network drive. If the user clicks on a file or folder in the second frame, that frame activates the entire window's controls, including the first frame. For file types that the browser cannot handle, such as *.txt files, the corresponding application window will be opened.

Although Web folders are part of the file system hierarchy, this technology does not always represent the actual contents of the file system. A typical example is Network Neighborhood.

html The scope of use of the frameset tag:

This element is available in HTML in Microsoft® Internet Explorer 3.0 and in scripts in Internet Explorer 4.0.

Note: The

tag cannot be used together with the tag. However, if you need to add a tag for browsers that don't support frames, be sure to follow the tag pair within the <noframes> tag before you can use any of the familiar Label. <p><strong>HTML <frameset> tag example: </frameset></strong></p> <p>Simple three-frame page: </p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false">&lt;html&gt; &lt;frameset cols=&quot;25%,50%,25%&quot;&gt; &lt;frame src=&quot;frame_a.htm&quot; /&gt; &lt;frame src=&quot;frame_b.htm&quot; /&gt; &lt;frame src=&quot;frame_c.htm&quot; /&gt; &lt;/frameset&gt; &lt;/html&gt;</pre><div class="contentsignin">Copy after login</div></div><p><strong>html Tips and comments for the frameset tag: </strong></p><p>Tip: It is important to note that browsers allow users to manually resize the rows or columns of a single frame document, and thus change the relative proportion of each frame in the frame display. Unless you explicitly tell the browser not to do this. To prevent this, you can use the noresize attribute in the <frame> tag. </p><p>Note: If you wish to validate a page that contains frames, make sure the DTD is set to "Frameset DTD". Read more about XHTML validation. </p><p>Important: You cannot use the <body></body> tag with the <frameset></frameset> tag. However, if you need to add a <noframes> tag for browsers that don't support frames, be sure to place the tag within the <body></body> tag! </p><p>html Optional attributes of the frameset tag: </p><p><img src="https://img.php.cn//upload/image/223/354/882/1534468985971134.png" title="1534468985971134.png" alt="How to use html frameset tag? Detailed explanation of html frameset tag attributes"/></p><p><strong>html Standard attributes of the frameset tag: </strong></p><p>id, class, title, style</p><p><strong>Cols attribute and rows attribute of HTML <frameset> tag</strong></p><p><strong>html Function and usage of frameset tag:</strong># The </p>##<frameset> tag has a required attribute: either rows or cols, depending on your selection, which define the row or column sizes of the frame or nested frameset in the document window. and quantity. <p></p>Both properties accept a quoted, comma-separated list of values ​​that specify the absolute (pixels) or relative (percentage or remaining space) width of the frame (for columns), Or absolute or relative height (for rows). The number of these property values ​​determines how many rows or columns of frames the browser will display in the document window. <p></p>As with tables, the browser will try to display it as close to the given frameset dimensions as possible. However, the browser does not extend the bounds of the document window to accommodate framesets that extend beyond the edges, nor does the browser fill the window with empty space if the specified frame does not fill the entire window. Instead, the browser allocates space based on a frame's size relative to other frames in rows and columns, so that it fills the entire document window. (Did you notice that there are no scroll bars in a main frame document?) <p></p>The following are three examples: <p></p><p>Example 1<strong></strong></p>The following code A 3-line frame will be created: <p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false">&lt;frameset rows=&quot;150,300,150&quot;&gt;</pre><div class="contentsignin">Copy after login</div></div></p> Each of these lines spans the entire length of the document window. The first and last frames are set to 150 pixels high, and the second row is set to 300 pixels high. <p><p>实际上,除非浏览器窗口正好是 600 像素高,否则浏览器将会自动按照比例延伸或压缩第一和最后一个框架,使得这两个框架都占据 1/4 的窗口空间。中间行将会占据剩下 1/2 的窗口空间。</p><p><strong>实例2</strong></p><p>用窗口尺寸的百分比表示的框架行和列尺寸数据更加实际。</p><p>例如,下面这个示例与刚才那个示例的效果相同:</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false">&lt;frameset rows=&quot;25%,50%,25%&quot;&gt;</pre><div class="contentsignin">Copy after login</div></div><p>当然,如果这些百分比加起来不是 100%,浏览器也会自动按照比例重新给出每行尺寸以消除差异。</p><p><strong>实例3</strong></p><p>如果你像我们一样,那么将问题综合起来就不是一件难事。可能有的框架设计人员正为同样的困难而感到苦恼,这就解释了为什么他们要在 <frameset> 的 rows 和 cols 值上加上星号。它告诉浏览器要在将相邻的框架放入框架集之后,给剩下的空间分配各自的行或列。</p><p>例如,当浏览器遇到下列框架标签时:</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false">&lt;frameset cols=&quot;100, *&quot;&gt;</pre><div class="contentsignin">Copy after login</div></div><p>上面的例子会生成一个宽为固定的 100 像素的列,然后再生成另一个框架列,该列会占据框架集中其余所有的空间。</p> <p>【相关推荐】</p> <p><a href="http://www.php.cn/div-tutorial-408459.html" target="_blank" title="HTML <fieldset> 标签的具体用法是什么?怎么用fieldset设置边框颜色?">HTML </a></p> <fieldset> 标签的具体用法是什么?怎么用fieldset设置边框颜色?<br><p><a href="http://www.php.cn/div-tutorial-408527.html" target="_blank" title="html textarea是什么意思?如何获取textarea标签中的换行符和空格?">html textarea是什么意思?如何获取textarea标签中的换行符和空格?</a><br></p> <p><br></p> </fieldset>

The above is the detailed content of How to use html frameset tag? Detailed explanation of html frameset tag attributes. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template