ui元素框架

tech2023-01-05  94

ui元素框架

描述 (Description)

The frameset is used to group a collection of windows together, sometimes horizontally (using the rows attribute), sometimes vertically (using the cols attribute), or even a combination of horizontal and vertical arrangements. Each child window inside the frameset is defined by the frame element.

框架集用于将窗口集合分组在一起,有时是水平的(使用rows属性),有时是垂直的(使用cols属性),甚至是水平和垂直排列的组合。 框架集中的每个子窗口由frame元素定义。

A frameset requires a special frameset-specific doctype, and does not allow for any content inside the body of the page (the frameset actually takes the place of the body element).

框架集需要特定于框架集的特殊doctype ,并且不允许页面主体内包含任何内容(框架集实际上代替了body元素)。

The simple HTML example shown above will create a frameset with two rows, as shown in Figure 1.

上面显示的简单HTML示例将创建一个包含两行的框架集,如图1所示。

It is possible to nest a frameset inside a parent frameset. Using the previous example, if we were to replace the second frame with a new frameset, that child frameset can include a further collection of frames, as detailed in the following markup:

可以将框架集嵌套在父框架集中。 使用前面的示例,如果我们要用新的框架集替换第二个框架,则该子框架集可以包含更多的框架集合,如以下标记所示:

<frameset rows="100,*"> <frame src="header.html"/> <frameset cols="33%,33%,*">Nested frameset <frame src="subframe1.html"/> <frame src="subframe2.html"/> <frame src="subframe3.html"/> </frameset> </frameset>

The result of this markup is shown in Figure 2.

标记的结果如图2所示。

Using frames/framesets can present additional difficulties for users when bookmarking pages. If you use the menu option to do this, or a keyboard shortcut, which page is it going to store as a favourite – the framed content or frameset as a whole? To be absolutely sure, the user has to right click (or CTRL click for Mac users) on the frame that needs to be added as a favourite and choose from that menu. Printing pages is also not quite as straightforward (do you want to print the whole frameset or just one portion?). Finally, navigating around the pages using keyboard only can be cumbersome, for example tabbing through navigation on one frame, then tabbing to another frame to read content, then back to the navigation frame, and so on.

在为页面添加书签时,使用框架/框架集可能给用户带来其他困难。 如果您使用菜单选项或键盘快捷键来执行此操作,则它将哪个页面存储为收藏夹-框架内容或框架集整体? 要绝对确定,用户必须在需要添加为收藏夹的框架上单击鼠标右键(对于Mac用户,则为CTRL单击),然后从该菜单中进行选择。 打印页面也不是那么简单(您要打印整个框架集还是仅打印一部分?)。 最后,仅使用键盘在页面上导航可能很麻烦,例如,在一个框架上浏览,然后在另一个框架上浏览以读取内容,然后回到导航框架,依此类推。

An additional note about search engines – if the content is intended to be viewed within a framed context and the page comes up in search results, when the user clicks to view that page they will not see it in the context that it was originally intended – they become somewhat ‘orphaned’. You may therefore need to incorporate a ‘View this page in frameset’ link for this eventuality, which will almost certainly require some JavaScript logic to know first of all that the page is not in a frameset and secondly how to bring it back into a frameset context without losing the page.

有关搜索引擎的其他说明-如果要在带框架的上下文中查看内容并且页面出现在搜索结果中,则当用户单击以查看该页面时,他们将不会在其最初意图的上下文中看到该内容-他们变得有些“孤立”。 因此,您可能需要合并“在框架集中查看此页面”链接,以确保最终结果,这几乎肯定需要一些JavaScript逻辑才能知道该页面不在框架集中,其次要如何将其带回到框架集中上下文而不会丢失页面。

(Example)

Two horizontally laid-out frames defined by the frameset element:

frameset元素定义的两个水平布局的frameset :

<frameset rows="100,*"> <frame src="header.html"/> <frame src="home.html"/> </frameset>

将此用于… (Use this for…)

A typical situation where you might use a frameset is when you wish some part of the content to remain constantly loaded (e.g a navigation block) in one frame and have links in that window open content in another window. It is no longer necessary, however, to use frames (and by implication framesets) for the purposes of creating the visual effect of a header that remains at the top of the page while the rest of the content scrolls – this can be carried out using Cascading Style Sheets.

您可能会使用框架集的一种典型情况是,当您希望内容的某些部分在一个框架中保持不变的加载(例如,导航块),并且希望该窗口中的链接在另一窗口中打开内容。 但是,不再需要使用框架(并通过暗示框架集)来创建标题的视觉效果,而该标题保留在页面顶部,而其余内容滚动时–可以使用级联样式表。

翻译自: https://www.sitepoint.com/frameset-html-element/

ui元素框架

相关资源:HTML+css框架集合
最新回复(0)