Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




Frameset

We can divide the page in different frames. Frames gives us ability to split the browser window in diffreent parts horizontally or vertically. Framesets are used where we want to make window behave like two windows. We can split window in different frames. We can not use body tags with frame set. These type of sites having frame sets are not SEO friendly. With frame set we can see different HTML pages in a browser window. With the help of these user can keep track on multiple sites.

(for SEO(search engine optomization fremeless site is recomendded) While we use framesets body tag will not be used on that page after <head> we will write frameset.

            <html xmlns="http://www.w3.org/1999/xhtml" > 
            <head>
            <title>
            Frame set example
            </title>
            </head>
            <frameset cols="25%,75%">
            <frame src="http://www.google.com">
            <frame src="http://www.yahoo.com">
            </frameset>
            </html>

We can define the width or height of frames by giving the values:

<frameset cols="25%,75%">

It means first frame will have 25% and second will have the 75% of the browser window.

We can write the iframes also. Iframes creates the frame inside a window. To do that we need not to remove body tag. (In frameset we need to remove body tag.)

Example:




<html>

<body>
<iframe src="http://www.google.com">
</iframe>
<iframe src="http://www.yahoo.com">
</iframe>
<p> Some older browsers don't support iframes. If they don't, the iframe will not be visible. </p>
</body>
</html>
           

Noframe

The noframes element displays text for browsers that do not handle frames. The noframes element goes inside the frameset element.

Example

 <frameset cols = "25%, 25%,*">
<noframes>
<body>Your browser does
not handle frames!</body>
</noframes>
<frame src ="http:// www.google.com"/>
<frame src="http://www.yahoo.com" />
<frame src="http://www.mercur.htm"/>
</frameset>

Share this article   |    Print    |    Article read by 10443 times
Author:
Rohit kakria
I am software developer, moderator of xpode.com
Related Articles: No related article
Related Interview Questions: No related interview question