Friday, 17 August 2007
/ Kshitij Ahuja
|
You have a main navigation menu for your website and you don't want user to load whole page again and again. You just want that when user clicks a link in the menu, the relevant content loads quickly leaving intact the main navigation. OR may be you need to display data from multiple pages of your website on the same web page. The solution is frames.
The basic structure of a frame document is almost similar to the HTML document,except that the <BODY> tag is replaced with <FRAMESET> tag that describes the frames. Consider the code below : <HTML> <HEAD> </HEAD> <FRAMESET> This is a frame. </FRAMESET> </HTML> Frameset Tag This is the main container for the frame. Each frameset tag defines as set of rows and columns
ROWS The rows attribute specifies the number of rows in the frame. It can take either pixel values, percentage values from 1 through 100 or a relative scaling value. It can also accept a list of comma-separated values. Value - Simple numeric value assumed to be fixed size in pixels. eg.<frameset rows="1,2,7"> Value% - Simple percentage value between 1 and 100. eg.<frameset rows="5%,85%,10%"> Value* - The value * when used, is interpreted as a request to give the frame all the remaining space. If there is a value along with the * then that frame gets that much more relative space eg.<frameset rows="2*,*,*"> This allocates 2/4 space to first and 1/4 to remaining each rows. COLS Similar to ROWS, this is used to specify the columns in each frame. It is used in the similar way as ROWS is used in the FRAMESET.
Frame Tags This defines a single frame in the FRAMESET tag. The frame tag doesnot have an end tag. Following attributes are associated with frame tag :
SRC The SRC attribute specifies the URL of the document that is to be displayed in the frame. If the SRC attribute doesnt have any value, the frame is displayed blank. <FRAME src="URL"> NAME The NAME attribute is used to assign a name to the frame so that it can be referred by or targeted by links in other documents. This attribute is optional, however. Certain names are reserved and begin with an underscore. Some of them are : _blank : This is used when the link is to be loaded in a new window. _self : This is used when the link is to be loaded in existing frames. _parent : link is to be loaded over a previous frame. _top : link is to be loaded in at the top level. MARGINWIDTH="value" This attribute is used to control the width of margins of the document. It can have a pixel value. This attribute is also optional. MARGINHEIGHT="value" The MARGINHEIGHT attribute is almost similar to MARGINWIDTH except that MARGINHEIGHT is used to specify the top and bottom margins instead of left and right. This attribute is also optional. SCROLLING="yes/no/auto" The attribute specifies if there should be a scroll bar on the page or not or if should be automatically judged for its requirement. NORESIZE The attribute has no value and is used just to inform the browser that the frame is not resizeable. FRAMEBORDER="value" This attribute specifies the value border width of the frame. If set to zero, the frame has no border. FRAMESPACING="value" This attribute is used to allow extra space around the frame to give it a different appearance. The value is the basically the spacing around the frame in pixels. | Tag | Description | <frameset> <frame> <noframes> <iframe> | Defines a set of frames Defines a sub window (a frame) Defines a noframe section for browsers that do not handle frames Defines an inline sub window (frame) |
|