
HTML Page Frames :
Frame divides browser window into several parts through which we can see more than one web page at a time. Multiple scrollable sections can be created using frames. Each window is called a 'frame' and each frame is independent of the others. Frame pages can also be hyperlinked.
Creating Frames :
The <frameset>----------</frameset> Tags :
- The <frameset> tag is a container tag for all other tags that are used to create frames.
- The <frameset> tag replaces the <body> tag in frameset documents.
- The <frameset> tag defines how to divide the window into frames.
- Each frameset defines a set of rows or columns. If user define frames by using rows then horizontal frames are created. If user defines frames by using columns then verticle frames are created.
- The values of the rows/columns indicate the amount of screen area each row/column, that will occupy.
- Each frame is indicated by <frame> tag and it define what HTML document to put into the frame.
The Rows attribute :The rows attribute divides the screen into horizontal frames.
Let's understand with an example
Programe :
Output :
In the above example we have a frameset with two rows. The first row us set of 25% of the width of the browser window and the second row is set of to 75% of the width of the browser window. The page1.html is of first row and page2.html is of second row.The cols attribute :The cols attribute divides the browser window into verticle frames depending upon the width defined.
The following example illustrates the concept
Programe :
Output :
In the above example, the frames of page1.html is set to 100 pixels, page2.html is set to 45% of the available area and the page3.html takes up the remaining area.The total area of all the rows and the cols must be either defined in terms of pixels, or a percentage value (%) or relative value by using (*) asterisk sign.The <frame> tag :The <frame> tag is used to create frames within frameset. The attribute of this tags can be used to specify the name of a frame and the HTML page you need to display in the frame.The following are the various attribute of the <frame> tag :
- SRC : This attribute is used to specify HTML page that you want to display in the frame.
E.g <frame SRC="URL of an HTML page">
- Frameborder : This attribute shows border around the frame. The value 0 creates borderles frame. The value 1 gives border.
- Marginwidth : This attribute sets left and right frame margin in pixels.
E.g. <frame SRC="page1.html" marginwidth=25>
- Marginheight : This attribute sets Top and Bottom frame margin in pixels.
E.g. <frame SRC="page1.html" marginheight=25>
- Noresize : This attribute prevents the user from resizing the frames. By default user can resize frame by dragging to new position.
E.g <frame SRC="page1.html> noresize>
- Name : It is used to assign name to the frame for targeting and linking purpose.
E.g. <frame SRC="page1.html" name="xyz">
- Scrolling : The scrolling has three values YES, NO, AUTO
1. The value YES specifies that a scrollbar should always be visible on the frame.
2. The value NO specifies that a scrollbar never be visible on the frame.
3. The value AUTO specifies the browser to automatically display or remove the scrollbar from a frame. This is default value.
No comments:
Post a Comment
If you have any doubts regarding this please comment or email us.