字幕列表 影片播放 列印英文字幕 A page can be divided into frames using a special frame document. In this document the <frameset> element replaces the <body> tag and contains only frame information. The element requires either the cols or rows attribute to specify the number of frames and their sizes. Both attributes accept a comma-separated list where the size is given in either pixels, percentage, or remaining space which is indicated by an asterisk. The remaining space can also be divided up among multiple frames in any proportion. Also, we can change the color, size, and display of the borders. Bordercolor sets the color of the border and both the border and framespacing attributes changes the size of the border. Frameborder can be used to hide the borders or we can remove them completely by setting the border size to zero. By default the border is 6 pixels wide. Within the <frameset> we add a number of <frame> elements equal to how many we specified using the cols or rows attribute. The source attribute (src) which gives the location of each document needs to be included. The frames are added from left to right and top to bottom. For each frame we can control the scrollbars, resizing, and border display. By default, the scrollbars are displayed whenever they are needed. We can also use the scrolling attribute to force the scrollbars to be shown or not shown. The noresize attribute will prevent us from dragging the border in the browser to resize it. And the frameborder attribute lets us hide the border for this individual frame. Before we can link to a frame it needs to be given a name. Once named we can then target the frame using the target attribute for the hyperlink. This attribute can also be applied to the <base> tag in order to set a default target. In addition to the frame name there are four other targets that have special meanings. "_blank loads" the document in a new window. "_self loads" it in the current frame. "_parent" loads it into the immediate <frameset> parent of the current frame and thereby removes a <frameset> if there is any. And finally, "_top" removes all frames and loads the link into the full window. Lastly, the <noframes> element provides a way for older browser not supporting frames to be able to view the page. It can contain an alternative page, complete with the <body> tag and any other elements.
B1 中級 HTML教程 - 15 - 框架 (HTML Tutorial - 15 - Frames) 8 4 Pan-Shy Gang 發佈於 2021 年 01 月 14 日 更多分享 分享 收藏 回報 影片單字