IFRAMES and its Rising Popularity - The Article (Page 2 of 3 )
Working of an Iframe
The IFRAME element allows authors to insert a frame within a block of text. Inserting an inline frame within a section of text is much like inserting an object via the OBJECT element: they both allow you to insert an HTML document in the middle of another, they may both be aligned with surrounding text, etc.
Here the tags enclosed are empty as the Inline Frames recognizes only “src” as its main attribute. The “src” defines the page to be displayed inside the frame. This “src” attribute functions similar to the image src tag (<img src=”fig.gif”>)
User agents that do not support frames or are configured not to display frames, on the other hand, should only display the contents of the IFRAME element.
<iframe width=150 height=200 src="trial.htm">IF YOU ARE ABLE TO SEE THIS TEXT, THEN YOUR BROWSER IS NOT COMPATIBLE WITH IFRAMES. PLEASE UPGRADE YOUR BROWSER! </iframe>
The most common attributes for <iframe> are the following
SRC=URI (URI of frame content)
NAME=CDATA (name of frame)
LONGDESC=URI (link to long description)
WIDTH=Length (frame width)
HEIGHT=Length (frame height)
ALIGN=[ top | middle | bottom | left | right ] (frame alignment)
FRAMEBORDER=[ 1 | 0 ] (frame border)
MARGINWIDTH=Pixels (margin width)
MARGINHEIGHT=Pixels (margin height)
SCROLLING=[ yes | no | auto ] (ability to scroll)
These are few of the attributes, usage of them differs as per your requirements.
For more detailed information on the functioning of each attribute check out these below mentioned links for more options of <iframe> tag
Internet Explorer has supported iframe since version 3. However, IE as well other browsers have problems in the support, as discussed later in this document.
Netscape 6 supports iframe. It has been reported that Netscape 4.7 on Mac has iframe support, but all Netscape 4.x versions on Windows probably lack support. And it has been reported that Mozilla M12 supports iframe.
iCab supports it, with a user option to disable the support.
WebTV Plus has iframe support, but the "small bugs" include failure to comply with the fundamental idea of using the content of the element only if the inline frame itself is not displayed.
Lynx 2.8.2 handles iframe in a manner similar to its treatment of normal frames: it provides a link (preceded by the text IFRAME:) to the document specified in the src attribute of the iframe tag and then renders the content of the iframe element. As the link text, it uses the name attribute if present, otherwise the URL (the src attribute value).
Opera 4.0 beta supports iframe, with the option to turn the support off (as independently of normal frame support), and the default setting seems to be to have the support disabled.
Browsers, which do not support iframe, are expected to ignore the start and end tags of the element and render its content instead. This is a special case of the general idea of ignoring unknown tags. This could fail if a browser does recognize iframe but has a fundamentally incorrect implementation for it.
Inline Frames vs. Normal Frames
Normal frames are used to divide the entire browser window (or a frame) to sub windows. Inline frames appear inside the presentation of a document much the same way as images are: the browser allocates some space for an inline frame and takes this into account when rendering the document. This means, in particular, that an inline frame as a whole scrolls along with the rest of the document, so it might be scrolled away. Whether this is positive or negative depends on the aims and nature of the page. (An inline frame usually has its own internal scroll bar too, for scrolling its own content.)
Example of an Iframe in a menu driver program
1st step: Create a page called Main.htm and copy the following code into it
I have tried to give you a brief examples using <iframe>,<div> and other main tags to create a simple menu driven program to understand the concepts. Once you have mastered the simple logic behind Iframes developing your own optional code becomes easier.
Common Application of Iframes
Creating an entire menu driven webpage.
Creating a simple display box for different images in the same page.
Creating alternative information’s for the pages.
Many more optional solution rests at the hands of the user.
As I was trying to find out the limitations to the code, I found very few which I mention below
Most of the older browser fails to recognize Iframes.
Some attributes differ in different browsers.
As I learnt very recently, most of the search engines do not index pages using Iframes. So the optional solution will be to - use a sitemap and link directly into the iframe page - remembering to force the orphan iframe back into its frameset.